diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-08-25 12:52:57 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-08-25 12:52:57 +0200 |
commit | 1e85d61867341ebf0393bd0b947a5c2204d7c2c1 (patch) | |
tree | f7f2ceb3cc02d52be9a36a16ff80f99327783482 /ishtar_common/tests.py | |
parent | 6cd180a97f8914a27d6e703a59dec8e7661cf99b (diff) | |
download | Ishtar-1e85d61867341ebf0393bd0b947a5c2204d7c2c1.tar.bz2 Ishtar-1e85d61867341ebf0393bd0b947a5c2204d7c2c1.zip |
Tests: add simple cache test
Diffstat (limited to 'ishtar_common/tests.py')
-rw-r--r-- | ishtar_common/tests.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/ishtar_common/tests.py b/ishtar_common/tests.py index b779af221..5add2e2cf 100644 --- a/ishtar_common/tests.py +++ b/ishtar_common/tests.py @@ -140,6 +140,20 @@ class WizardTest(object): self.post_wizard() +class CacheTest(TestCase): + def testAdd(self): + cached = models.OrganizationType.get_cache('test') + self.assertEqual(cached, None) + orga = models.OrganizationType.objects.create( + txt_idx='test', label='testy') + cached = models.OrganizationType.get_cache('test') + self.assertEqual(cached.pk, orga.pk) + orga.txt_idx = 'testy' + orga.save() + cached = models.OrganizationType.get_cache('testy') + self.assertEqual(cached.pk, orga.pk) + + class MergeTest(TestCase): def setUp(self): self.user, created = User.objects.get_or_create(username='username') |