diff options
| author | Mike Fogel <mike@fogel.ca> | 2014-04-11 23:58:56 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-04-30 07:57:35 -0400 |
| commit | bb5c7e4e8d783bf3a2880ab5cf1fa57fd35cd198 (patch) | |
| tree | fed00c72054a0ce1be074370c52a0603ce91a6fa /tests/field_subclassing/fields.py | |
| parent | 6d4df45e2927c45344b9f014f739466d61f808c8 (diff) | |
[1.7.x] Fixed #22537 -- Add tests and improved docs for field subclass with choices.
Backport of 7fd1b35ed7 from master
Diffstat (limited to 'tests/field_subclassing/fields.py')
| -rw-r--r-- | tests/field_subclassing/fields.py | 5 |
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)): """ |
