Пример #1
0
 def test_topic_model_create(self):
     topic = self.create_topic()
     rev_origin = topic_cache.version(topic)
     Person = topic.get_models_module().Person
     p = Person.objects.create(first_name='Pierre', name='Bellon')
     rev_target = topic_cache.version(topic)
     self.assertEqual(rev_target, rev_origin + 1)
Пример #2
0
 def test_topic_update(self):
     # if we update a topic, its revision number should be incremented
     topic = self.create_topic()
     rev = topic_cache.version(topic)
     topic.title = "New title"
     topic.save()
     self.assertEqual(topic_cache.version(topic), rev+1)
Пример #3
0
 def test_topic_model_create(self):
     topic = self.create_topic()
     Person = topic.get_models_module().Person
     p = Person.objects.create(first_name="Pierre", name="Bellon")
     rev_origin = topic_cache.version(topic)
     p = Person.objects.get(first_name="Pierre", name="Bellon")
     p.first_name = "Matthieu"
     p.save()
     rev_target = topic_cache.version(topic)
     self.assertEqual(rev_target, rev_origin + 1)
Пример #4
0
 def test_topic_delete(self):
     topic = self.create_topic()
     rev = topic_cache.version(topic)
     topic.delete()
     self.assertEqual(topic_cache.version(topic), rev+1)
Пример #5
0
 def test_topic_creation(self):
     topic = self.create_topic()
     rev = topic_cache.version(topic)
     self.assertIsNotNone(rev, 0)