mirror of
https://github.com/Hopiu/django-model-utils.git
synced 2026-03-17 04:10:24 +00:00
Resolve duplication between two pull requests for Choices.__len__.
This commit is contained in:
parent
4217dbd7fe
commit
41607c0b56
2 changed files with 1 additions and 6 deletions
|
|
@ -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)))
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue