Ticket #7789: 7789_tests.diff

File 7789_tests.diff, 1.1 KB (added by arne, 16 years ago)

Regressiontests

  • regressiontests/model_regress/models.py

     
    3232class Event(models.Model):
    3333    when = models.DateTimeField()
    3434
     35# #7789
     36class Julian(models.Model):
     37    name = models.CharField(max_length=20, unique=True)
     38
     39class Julian2(models.Model):
     40    slug = models.SlugField(unique=True)
     41   
    3542__test__ = {'API_TESTS': """
    3643(NOTE: Part of the regression test here is merely parsing the model
    3744declaration. The verbose_name, in particular, did not always work.)
     
    8794datetime.datetime(2000, 1, 1, 13, 1, 1)
    8895>>> e.get_previous_by_when().when
    8996datetime.datetime(2000, 1, 1, 6, 1, 1)
     97
     98
     99# #7789 MySQL case-insensitive unique constraints
     100>>> Julian.objects.get_or_create(name='Julian')[1]
     101True
     102>>> Julian.objects.get_or_create(name='julian')[1]
     103True
     104>>> Julian2.objects.get_or_create(slug='Julian')[1]
     105True
     106>>> Julian2.objects.get_or_create(slug='julian')[1]
     107True
    90108"""
    91109}
Back to Top