Skip to content

Commit

Permalink
test adjustment
Browse files Browse the repository at this point in the history
  • Loading branch information
lucianHymer committed Jul 7, 2023
1 parent fb2e46c commit a0a6b2f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions api/registry/test/test_score_passport.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,11 +306,14 @@ def test_lifo_duplicate_stamp_scoring(self):
}

with patch("registry.atasks.validate_credential", side_effect=mock_validate):
# Score original passport
with patch(
"registry.atasks.aget_passport", return_value=mock_passport_data
):
score_registry_passport(self.community.pk, passport.address)

# Score passport with duplicates (one duplicate from original passport,
# one duplicate from already existing stamp)
with patch(
"registry.atasks.aget_passport",
return_value=mock_passport_data_with_duplicates,
Expand All @@ -332,3 +335,11 @@ def test_lifo_duplicate_stamp_scoring(self):
assert (
Score.objects.get(passport=passport_with_duplicates).score
) == Decimal("1")

# Re-score original passport, just to make sure it doesn't change
with patch(
"registry.atasks.aget_passport", return_value=mock_passport_data
):
score_registry_passport(self.community.pk, passport.address)

assert (Score.objects.get(passport=passport).score) == Decimal("3")

0 comments on commit a0a6b2f

Please sign in to comment.