diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-09-24 16:21:37 +0200 |
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-09-24 16:21:37 +0200 |
| commit | b87c07172fcb86b5d91fda7424489a813f4f0498 (patch) | |
| tree | 35bfed10cb8bae003612931d79e1aad96dd0b371 /ishtar_common/tests.py | |
| parent | 38f6d33d2153db1370a04d9dd8b11b0469725e72 (diff) | |
| parent | 3120af6c41157b71561d6fd5a68fc6022f6dbadf (diff) | |
| download | Ishtar-b87c07172fcb86b5d91fda7424489a813f4f0498.tar.bz2 Ishtar-b87c07172fcb86b5d91fda7424489a813f4f0498.zip | |
Merge branch 'v0.9' into wheezy
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): |
