Code Duplication    Length = 11-11 lines in 2 locations

django-data/image/common/tests/test_helpers.py 2 locations

@@ 68-78 (lines=11) @@
65
        self.assertEqual(len(cm.output), 1)
66
        self.assertIn("Ignoring one date", cm.output[0])
67
68
    def test_null_date(self):
69
        t1 = None
70
        t2 = parse_date("1900-01-01")
71
72
        with self.assertLogs('common.helpers', level="WARNING") as cm:
73
            years, units = image_timedelta(t1, t2)
74
75
        self.assertIsNone(years)
76
        self.assertEqual(units, constants.YEARS)
77
        self.assertEqual(len(cm.output), 1)
78
        self.assertIn("One date is NULL", cm.output[0])
79
80
81
class TestAttributes(TestCase):
@@ 56-66 (lines=11) @@
53
        self.assertEqual(days, 7)
54
        self.assertEqual(units, constants.DAYS)
55
56
    def test_unknown_date(self):
57
        t1 = parse_date("2019-03-20")
58
        t2 = parse_date("1900-01-01")
59
60
        with self.assertLogs('common.helpers', level="WARNING") as cm:
61
            years, units = image_timedelta(t1, t2)
62
63
        self.assertIsNone(years)
64
        self.assertEqual(units, constants.YEARS)
65
        self.assertEqual(len(cm.output), 1)
66
        self.assertIn("Ignoring one date", cm.output[0])
67
68
    def test_null_date(self):
69
        t1 = None