def test_callback_called_on_modification_with_watch(self): new_instance = ArticleFactory() self.watcher.watch() new_instance.author = UserFactory() new_instance.save() # callback should be called with instance modification self.callback.assert_called_once_with( obj=new_instance, attr=self.attr, sender=self.watcher)
def test_callback_called_on_modification_with_watch(self): new_instance = ArticleFactory() self.watcher.watch() new_instance.author = UserFactory() new_instance.save() # callback should be called with instance modification self.callback.assert_called_once_with(obj=new_instance, attr=self.attr, sender=self.watcher)
def test_callback_not_called_on_modification_without_watch(self): new_instance = ArticleFactory() new_instance.author = UserFactory() new_instance.save() # have not watched, thus callback should not be called self.assertFalse(self.callback.called)
def test_callback_not_called_on_modification_without_watch(self): new_instance = ArticleFactory() new_instance.author = UserFactory() new_instance.save() # have not watched, thus callback should not be called self.assertFalse(self.callback.called)