Resolve duplication between two pull requests for Choices.__len__.

This commit is contained in:
Carl Meyer 2013-01-26 17:04:15 -08:00
parent 4217dbd7fe
commit 41607c0b56
2 changed files with 1 additions and 6 deletions

View file

@ -133,9 +133,6 @@ class Choices(object):
def __getitem__(self, index):
return self._choices[index]
def __len__(self):
return len(self._choices)
def __repr__(self):
return '%s(%s)' % (self.__class__.__name__,
', '.join(("%s" % str(i) for i in self._full)))

View file

@ -197,9 +197,6 @@ class ChoicesTests(TestCase):
def test_wrong_length_tuple(self):
self.assertRaises(ValueError, Choices, ('a',))
def test_len(self):
self.assertEquals(len(self.STATUS), len(self.STATUS._choices))
class LabelChoicesTests(ChoicesTests):
@ -655,6 +652,7 @@ class PassThroughManagerTests(TestCase):
unqs = pickle.loads(saltyqs)
self.assertEqual(unqs.by_name('The Dude').count(), 1)
def test_queryset_not_available_on_related_manager(self):
dude = Dude.objects.by_name('Duder').get()
Car.objects.create(name='Ford', owner=dude)