diff options
Diffstat (limited to 'ishtar_common/tests.py')
-rw-r--r-- | ishtar_common/tests.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/ishtar_common/tests.py b/ishtar_common/tests.py index 8c918b5a9..0c4bbda08 100644 --- a/ishtar_common/tests.py +++ b/ishtar_common/tests.py @@ -143,6 +143,7 @@ class WizardTest(object): class CacheTest(TestCase): def testAdd(self): + models.OrganizationType.refresh_cache() cached = models.OrganizationType.get_cache('test') self.assertEqual(cached, None) orga = models.OrganizationType.objects.create( @@ -154,6 +155,21 @@ class CacheTest(TestCase): cached = models.OrganizationType.get_cache('testy') self.assertEqual(cached.pk, orga.pk) + def testList(self): + models.OrganizationType.refresh_cache() + types = models.OrganizationType.get_types() + # only empty + self.assertTrue(len(types), 1) + org = models.OrganizationType.objects.create( + txt_idx='test', label='testy') + types = [ + unicode(lbl) for idx, lbl in models.OrganizationType.get_types()] + self.assertTrue('testy' in types) + org.delete() + types = [ + unicode(lbl) for idx, lbl in models.OrganizationType.get_types()] + self.assertFalse('testy' in types) + class MergeTest(TestCase): def setUp(self): |