diff --git a/src/olympia/blocklist/tests/test_mlbf.py b/src/olympia/blocklist/tests/test_mlbf.py index 892363a009a..de85b705f1d 100644 --- a/src/olympia/blocklist/tests/test_mlbf.py +++ b/src/olympia/blocklist/tests/test_mlbf.py @@ -532,27 +532,30 @@ def test_diff_all_possible_changes(self): ) # The second version is hard blocked. block_factory(guid=two.guid, updated_by=self.user, block_type=BlockType.BLOCKED) - # 3. Soft blocked -> (Blocked) + # 3 was soft-blocked and is now hard blocked. three_block.blockversion_set.first().update(block_type=BlockType.BLOCKED) - # 4. Soft blocked -> (Not blocked) + # 4 was soft blocked and is now unblocked. four_block.delete() - # 5. Blocked -> (Soft blocked) + # 5 was hard blocked and is now soft blocked. five_block.blockversion_set.first().update(block_type=BlockType.SOFT_BLOCKED) - # 6. Blocked -> (Not blocked) + # 6 was hard blocked and is now unblocked. six_block.delete() + + # We regenerate another MLBF based on the updates we've just done to verify the final + # state of each version. second_mlbf = MLBF.generate_from_db('second') # The order is based on the ID (i.e. creation time) of the block, - # not the version so we expect two after three - # since two was blocked after three + # not the version so we expect two after three since two was + # blocked after three. assert second_mlbf.generate_diffs(previous_mlbf=first_mlbf) == { BlockType.BLOCKED: ( [three_hash, two_hash], [five_hash, six_hash], 4, ), - # Same as above, one had a block created after five so it comes second + # Same as above, one had a block created after five so it comes second. BlockType.SOFT_BLOCKED: ( [five_hash, one_hash], [three_hash, four_hash],