Commits

adamv committed 17421d7

Add a (failing) test for #57

  • Participants
  • Parent commits 4d85696

Comments (0)

Files changed (1)

tests/test_main/regressiontests/tests.py

 from django.db import models
 from django.test import TestCase
 
+
+class Bug57Table(models.Model):
+    s = models.CharField(max_length=10)
+
+class Bug57TestCase(TestCase):
+    def testAllDistinctLimit(self):
+        Bug57Table(s='abc').save()
+        Bug57Table(s='abc').save()
+        Bug57Table(s='abc').save()
+        Bug57Table(s='def').save()
+        Bug57Table(s='def').save()
+        Bug57Table(s='fgh').save()
+        Bug57Table(s='fgh').save()
+        Bug57Table(s='fgh').save()
+        Bug57Table(s='fgh').save()
+        Bug57Table(s='ijk').save()
+        Bug57Table(s='ijk').save()
+        Bug57Table(s='xyz').save()
+        
+        stuff = list(Bug57Table.objects.all().distinct()[2:4])
+        self.assertEquals(len(stuff), 2)
+
+
 class Bug46Table(models.Model):
     s = models.CharField(max_length=10)