Code Duplication    Length = 11-11 lines in 2 locations

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

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