Ticket #18530: 18530.admin-filter-500.diff

File 18530.admin-filter-500.diff, 1.4 KB (added by Julien Phalip, 12 years ago)
  • tests/regressiontests/admin_views/models.py

    diff --git a/tests/regressiontests/admin_views/models.py b/tests/regressiontests/admin_views/models.py
    index ab2bc20..92ab5c8 100644
    a b class Color2(Color):  
    118118class Thing(models.Model):
    119119    title = models.CharField(max_length=20)
    120120    color = models.ForeignKey(Color, limit_choices_to={'warm': True})
     121    date = models.DateField(blank=True, null=True)
    121122    def __unicode__(self):
    122123        return self.title
    123124
  • tests/regressiontests/admin_views/tests.py

    diff --git a/tests/regressiontests/admin_views/tests.py b/tests/regressiontests/admin_views/tests.py
    index f074d77..6fc6da3 100644
    a b class AdminViewBasicTest(TestCase):  
    453453        response = self.client.get('/test_admin/%s/admin_views/thing/' % self.urlbit, {'color__id__exact': 'StringNotInteger!'})
    454454        self.assertRedirects(response, '/test_admin/%s/admin_views/thing/?e=1' % self.urlbit)
    455455
     456        # Regression test for #18530
     457        response = self.client.get('/test_admin/%s/admin_views/thing/' % self.urlbit, {'date__gte': 'foo'})
     458        self.assertRedirects(response, '/test_admin/%s/admin_views/thing/?e=1' % self.urlbit)
     459
    456460    def testIsNullLookups(self):
    457461        """Ensure is_null is handled correctly."""
    458462        Article.objects.create(title="I Could Go Anywhere", content="Versatile", date=datetime.datetime.now())
Back to Top