From 7fcd61d472549c15cfc81b6ac469fb7c5554f0c5 Mon Sep 17 00:00:00 2001 From: Matt Dahl Date: Sat, 15 Jul 2023 00:29:52 -0700 Subject: [PATCH] test(models): Adds test for nominative reporter equality (#154). --- tests/test_ModelsTest.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/test_ModelsTest.py b/tests/test_ModelsTest.py index 0da6524..3a41c65 100644 --- a/tests/test_ModelsTest.py +++ b/tests/test_ModelsTest.py @@ -94,6 +94,20 @@ def test_citation_comparison_with_different_source_text(self): self.assertEqual(hash(citations[0]), hash(citations[1])) print("✓") + def test_citation_comparison_with_nominative_reporter(self): + """Are two citation objects equal when their attributes are + the same, even if one of them has a nominative reporter?""" + citations = [ + get_citations("5 U.S. 137")[0], + get_citations("5 U.S. (1 Cranch) 137")[0], + ] + print( + "Testing citation comparison with nominative reporter...", end=" " + ) + self.assertEqual(citations[0], citations[1]) + self.assertEqual(hash(citations[0]), hash(citations[1])) + print("✓") + def test_citation_comparison_with_different_reporter(self): """Are two citation objects different when they have different reporters, even if their other attributes are the same?