Ticket #7789: 7789_tests_3.diff
File 7789_tests_3.diff, 1.5 KB (added by , 16 years ago) |
---|
-
regressiontests/model_regress/models.py
32 32 class Event(models.Model): 33 33 when = models.DateTimeField() 34 34 35 # #7789 36 class Julian(models.Model): 37 name = models.CharField(max_length=20, unique=True) 38 39 class Julian2(models.Model): 40 slug = models.SlugField(unique=True) 41 35 42 __test__ = {'API_TESTS': """ 36 43 (NOTE: Part of the regression test here is merely parsing the model 37 44 declaration. The verbose_name, in particular, did not always work.) … … 87 94 datetime.datetime(2000, 1, 1, 13, 1, 1) 88 95 >>> e.get_previous_by_when().when 89 96 datetime.datetime(2000, 1, 1, 6, 1, 1) 97 98 99 # #7789 MySQL case-insensitive unique constraints 100 # The follwing tests require that settings.TEST_DATABASE_CHARSET 101 # is set to 'utf8' for mysql. 102 >>> Julian.objects.get_or_create(name='Julian')[1] 103 True 104 >>> n, c = Julian.objects.get_or_create(name='julian') 105 >>> c 106 True 107 >>> n.name 108 'julian' 109 >>> Julian2.objects.get_or_create(slug='Julian')[1] 110 True 111 >>> n, c = Julian2.objects.get_or_create(slug=u'julian') 112 >>> c 113 True 114 >>> n.slug 115 u'julian' 116 >>> n, c = Julian.objects.get_or_create(name=u'\xf6') 117 >>> c 118 True 119 >>> n.name == u'\xf6' 120 True 121 >>> n, c = Julian.objects.get_or_create(name=u'\xf6') 122 >>> c 123 False 124 >>> n, c = Julian.objects.get_or_create(name=u'\xd6') 125 >>> c 126 True 127 >>> n.name == u'\xd6' 128 True 90 129 """ 91 130 }