Ticket #4562: 4562_tests.diff
File 4562_tests.diff, 968 bytes (added by , 17 years ago) |
---|
-
tests/modeltests/validation/models.py
17 17 favorite_moment = models.DateTimeField() 18 18 email = models.EmailField() 19 19 20 class Meta: 21 unique_together = ("name", "email") 22 20 23 def __unicode__(self): 21 24 return self.name 22 25 … … 150 153 >>> Person(name='John Doe', is_child=True, email='abc@def.com').validate() 151 154 {'favorite_moment': [u'This field is required.'], 'birthdate': [u'This field is required.']} 152 155 156 # check if unique_together lets us create persons which only differ by the case. 157 # This test will pass under sqlite but fail with mysql 158 >>> p = Person.objects.create(**valid_params) 159 >>> p 160 <Person: John> 161 162 >>> valid_params['name'] = 'JoHn' 163 >>> p = Person.objects.create(**valid_params) 164 >>> p 165 <Person: JoHn> 166 153 167 """}