diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-09-24 16:18:58 +0200 |
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-09-24 16:18:58 +0200 |
| commit | 193599c8588c803b342368fc4f65893950abaa82 (patch) | |
| tree | a2f56579405412bedfc88c46ad8db42e135d94d1 /ishtar_common/tests.py | |
| parent | edbae6181a5ba7284b7faba927ccd5b6e59b9b98 (diff) | |
| parent | e0d1446ec65b708ccbfcfedea03dab6756022287 (diff) | |
| download | Ishtar-193599c8588c803b342368fc4f65893950abaa82.tar.bz2 Ishtar-193599c8588c803b342368fc4f65893950abaa82.zip | |
Merge branch 'master' into v0.9
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): |
