Code Duplication    Length = 11-11 lines in 2 locations

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

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