File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 11import  sys 
22from  unittest  import  mock 
33
4+ import  django 
45import  pytest 
56from  django  import  forms 
67from  django .contrib .auth .models  import  User 
@@ -515,7 +516,14 @@ def test_char_fields_with_error_codes():
515516    assert  slug .error_codes  ==  {"invalid" , "null_characters_not_allowed" }
516517    assert  regex .error_codes  ==  {"invalid" , "required" , "null_characters_not_allowed" }
517518    assert  uuid .error_codes  ==  {"invalid" , "required" , "null_characters_not_allowed" }
518-     assert  ip .error_codes  ==  {"invalid" , "null_characters_not_allowed" }
519+     if  django .VERSION  >=  (4 , 2 ):
520+         assert  ip .error_codes  ==  {
521+             "invalid" ,
522+             "null_characters_not_allowed" ,
523+             "max_length" ,
524+         }
525+     else :
526+         assert  ip .error_codes  ==  {"invalid" , "null_characters_not_allowed" }
519527
520528
521529class  NumberForm (forms .Form ):
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments