Пример #1
0
 def test_modelsweeper_mixin(self):
     tmm = TestMixinModel(text='testing text')
     tmm.save()
     self.assertEquals(tmm.cachesweeper_version_key, 
                     'cachesweeper.test_models:TestMixinModel:%s' % tmm.pk)
     self.assertEquals(tmm.cachesweeper_version, 0)
     tmm.save()
     self.assertEquals(tmm.cachesweeper_version, 1)
Пример #2
0
 def test_default_version_zero(self):
     tmm = TestMixinModel(text='testing text')
     tmm.save()
     cache.delete(tmm.cachesweeper_version_key)
     self.assertEquals(tmm.cachesweeper_version, 0)
     tmm.save()
     self.assertEquals(tmm.cachesweeper_version, 1)
 
 # def test_modelsweeper_manager(self):
 #     tmm = TestManagerModel(text='testing text')
 #     self.assertTrue(hasattr(tmm.cachesweeper,'cachesweeper'))