| Total Complexity | 2 |
| Total Lines | 16 |
| Duplicated Lines | 0 % |
| 1 | from __future__ import unicode_literals |
||
| 10 | class AdminTests(AppTestCase): |
||
| 11 | """ |
||
| 12 | Test admin features |
||
| 13 | """ |
||
| 14 | |||
| 15 | def test_list_label(self): |
||
| 16 | # See that adding a field to the admin list_display also receives the translated title |
||
| 17 | # This happens by TranslatedFieldDescriptor.short_description |
||
| 18 | self.assertEqual(label_for_field('tr_title', SimpleModel), "Translated Title") |
||
| 19 | |||
| 20 | def test_list_label_abc(self): |
||
| 21 | # See that the TranslatedFieldDescriptor of the concrete model properly routes to the proper model |
||
| 22 | self.assertEqual(label_for_field('tr_title', ConcreteModel), "Translated Title") |
||
| 23 | |||
| 24 | # See that the TranslatedFieldDescriptor of the abstract model handles the fallback properly. |
||
| 25 | self.assertEqual(label_for_field('tr_title', AbstractModel), "Tr title") |
||
| 26 |