From 7fd1b35ed794e7d0a2a18f6ac168adba25a7de23 Mon Sep 17 00:00:00 2001 From: Mike Fogel Date: Fri, 11 Apr 2014 23:58:56 -0400 Subject: Fixed #22537 -- Add tests and improved docs for field subclass with choices. --- tests/field_subclassing/fields.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests/field_subclassing/fields.py') diff --git a/tests/field_subclassing/fields.py b/tests/field_subclassing/fields.py index d96ce8d873..c2158824df 100644 --- a/tests/field_subclassing/fields.py +++ b/tests/field_subclassing/fields.py @@ -20,6 +20,11 @@ class Small(object): def __str__(self): return '%s%s' % (force_text(self.first), force_text(self.second)) + def __eq__(self, other): + if isinstance(other, self.__class__): + return self.first == other.first and self.second == other.second + return False + class SmallField(six.with_metaclass(models.SubfieldBase, models.Field)): """ -- cgit v1.2.1