Anonymous avatar Anonymous committed cc12462 Merge

merge backout

Comments (0)

Files changed (3)

model_utils/__init__.py

         for i, choice in enumerate(self.equalize(choices)):
             self._choices += ((i, choice[0]),)
             self._iter_choices += ((i, choice[1]),)
-            self.set_display(choice[0], choice[1])
         self._choice_dict = dict(self._choices)
         self._reverse_dict = dict(((i[1], i[0]) for i in self._choices))
 
             else:
                 yield (choice, choice)
 
-    def set_display(self, name, value):
-        setattr(self, 'get_%s_display' % name.lower(), lambda: value)
-
     def __iter__(self):
         return iter(self._iter_choices)
 

model_utils/tests/test_settings.py

     'django.contrib.contenttypes',
     'model_utils',
     'model_utils.tests',
-)
+    )
 
 DATABASE_ENGINE = 'sqlite3'
 

model_utils/tests/tests.py

     def test_iteration(self):
         self.assertEquals(tuple(self.STATUS), ((0, 'DRAFT'), (1, 'PUBLISHED')))
 
-    def test_display(self):
-        self.assertEquals(self.STATUS.get_draft_display(), 'DRAFT')
 
 class LabelChoiceEnumTests(ChoiceEnumTests):
     def setUp(self):
     def test_iteration(self):
         self.assertEquals(tuple(self.STATUS), ((0, 'draft'), (1, 'published'), (2, 'DELETED')))
 
-    def test_display(self):
-        self.assertEquals(self.STATUS.get_deleted_display(), 'DELETED')
 
 class ChoicesTests(TestCase):
     def setUp(self):
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.