summaryrefslogtreecommitdiff
path: root/tests/field_subclassing/fields.py
diff options
context:
space:
mode:
authorMike Fogel <mike@fogel.ca>2014-04-11 23:58:56 -0400
committerTim Graham <timograham@gmail.com>2014-04-30 07:56:52 -0400
commit7fd1b35ed794e7d0a2a18f6ac168adba25a7de23 (patch)
tree6faef8b31515c3206b271abbd971f8923248e026 /tests/field_subclassing/fields.py
parent8ec388a69da13a8a5cf82604a26abe13be7dd1cb (diff)
downloaddjango-7fd1b35ed794e7d0a2a18f6ac168adba25a7de23.tar.gz
Fixed #22537 -- Add tests and improved docs for field subclass with choices.
Diffstat (limited to 'tests/field_subclassing/fields.py')
-rw-r--r--tests/field_subclassing/fields.py5
1 files changed, 5 insertions, 0 deletions
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)):
"""