Add testcases for updating with empty attributes

This commit is contained in:
sneakypete81 2013-09-14 12:18:38 +01:00
parent 8a4a806f8d
commit 5ccc03a835
3 changed files with 26 additions and 0 deletions

View file

@ -141,3 +141,11 @@ class TestActionView(TestActions):
self.assertEqual(action.target.id, "photo2")
self.assertEqual(action.target_type, "photo")
class TestActionMisc(TestActions):
def test_update_fields_with_no_target(self):
"""Check that an action object can be updated with no target"""
action = self.test_actions[0]
action.target = None
action.target_type = None
# Check that no exception is raised
action._update_fields_with_objects()