File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -130,6 +130,8 @@ def test_application_created_with_algorithm(self):
130
130
self .assertEqual (app .algorithm , "RS256" )
131
131
132
132
def test_validation_failed_message (self ):
133
+ import django
134
+
133
135
output = StringIO ()
134
136
call_command (
135
137
"createapplication" ,
@@ -143,7 +145,7 @@ def test_validation_failed_message(self):
143
145
output_str = output .getvalue ()
144
146
self .assertIn ("user" , output_str )
145
147
self .assertIn ("783" , output_str )
146
- # newer Django (>5.1) changes the error message from "does not exist" to "is not a valid choice"
147
- self .assertTrue (
148
- any ( substring in output_str for substring in [ "does not exist" , "is not a valid choice" ])
149
- )
148
+ if django . VERSION < ( 5 , 2 ):
149
+ self .assertIn ( "does not exist" , output_str )
150
+ else :
151
+ self . assertIn ( "is not a valid choice" , output_str )
You can’t perform that action at this time.
0 commit comments