--
Ticket URL: <https://code.djangoproject.com/ticket/33964>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* resolution: => worksforme
Comment:
The following test passes for me. Please provide details to reproduce.
{{{#!diff
diff --git a/tests/model_regress/models.py b/tests/model_regress/models.py
index 350850393a..369eada93f 100644
--- a/tests/model_regress/models.py
+++ b/tests/model_regress/models.py
@@ -11,6 +11,7 @@ class Article(models.Model):
status = models.IntegerField(blank=True, null=True, choices=CHOICES)
misc_data = models.CharField(max_length=100, blank=True)
article_text = models.TextField()
+ the_status = models.IntegerField(blank=True, null=True,
choices=CHOICES)
class Meta:
ordering = ("pub_date", "headline")
diff --git a/tests/model_regress/tests.py b/tests/model_regress/tests.py
index 10dfbabcd9..cd7c6f3c48 100644
--- a/tests/model_regress/tests.py
+++ b/tests/model_regress/tests.py
@@ -56,8 +56,9 @@ class ModelTests(TestCase):
# NOTE: Part of the regression test here is merely parsing the
model
# declaration. The verbose_name, in particular, did not always
work.
a = Article.objects.create(
- headline="Look at me!", pub_date=datetime.datetime.now()
+ headline="Look at me!", pub_date=datetime.datetime.now(),
the_status=1,
)
+ self.assertIs(a.get_the_status_display(), 'first')
# An empty choice field should return None for the display name.
self.assertIs(a.get_status_display(), None)
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/33964#comment:1>