Skip to content

Commit

Permalink
Add test for diffing with obsoleted units in source
Browse files Browse the repository at this point in the history
  • Loading branch information
phlax committed Aug 15, 2016
1 parent 6368183 commit 7748ea4
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/models/store.py
Expand Up @@ -1189,3 +1189,21 @@ def format_diff_provider(**kwargs):

assert isinstance(
differ.diffable, CustomDiffableStore)


@pytest.mark.django_db
def test_store_diff_delete_obsoleted_source_unit(diffable_stores):
target_store, source_store = diffable_stores
# delete a unit in the target store
remove_unit = target_store.units.first()
remove_unit.delete()
# and obsolete the same unit in the target
obsolete_unit = source_store.units.get(unitid=remove_unit.unitid)
obsolete_unit.makeobsolete()
obsolete_unit.save()
# as the unit is already obsolete - nothing
differ = StoreDiff(
target_store,
source_store,
target_store.get_max_unit_revision() + 1)
assert not differ.diff()

0 comments on commit 7748ea4

Please sign in to comment.