Skip to content
Snippets Groups Projects
Commit 2384af2a authored by Martin Burchell's avatar Martin Burchell
Browse files

Added another last modified update test

This one covers the case where an item is removed from a term.
parent c36b1ff0
No related branches found
No related tags found
1 merge request!7Data Layer updates a "last edit date" field on the Item
......@@ -87,3 +87,15 @@ def test_last_modified_date_updates_on_category_item_add(
term.items.add(item)
assert num_updates(orig_last_modified, last_modified(item)) == 1
@pytest.mark.django_db
def test_last_modified_date_updates_on_category_item_delete(
item, mock_time_now):
with patch('django.utils.timezone.now', new=mock_time_now):
term = TermFactory()
term.items.add(item)
orig_last_modified = last_modified(item)
term.items.remove(item)
assert num_updates(orig_last_modified, last_modified(item)) == 1
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment