@@ -0,0 +1,2216 @@
+import datetime%0Aimport unittest%0Afrom django.test import TestCase%0Afrom data_aggregator import utilities%0A%0A%0Aclass TestUtilities(TestCase):%0A%0A    def test_datestring_to_datetime(self):%0A        %22%22%22%0A        tests datestring_to_datetime%0A        %22%22%22%0A%0A        # bad input string%0A        with self.assertRaises(ValueError):%0A            utilities.datestring_to_datetime(%22Bad string%22)%0A%0A        # bad input not string or unicode%0A        with self.assertRaises(ValueError):%0A            utilities.datestring_to_datetime(int(19))%0A%0A        # %25Y-%25m-%25dT%25H:%25M:%25S.%25f good%0A        ret = utilities.datestring_to_datetime(%0A            %222019-01-01T23:59:59.999%22)%0A        self.assertTrue(ret)%0A        self.assertTrue(type(ret) is datetime.datetime)%0A%0A        # %25Y-%25m-%25dT%25H:%25M:%25S.%25f %3C 1900%0A        with self.assertRaises(ValueError):%0A            ret = utilities.datestring_to_datetime(%0A                %221777-01-01T23:59:59.999%22)%0A%0A        # %25Y-%25m-%25dT%25H:%25M:%25S.%25fZ good%0A        ret = utilities.datestring_to_datetime(%0A            %222019-01-01T23:59:59.999Z%22)%0A        self.assertTrue(ret)%0A        self.assertTrue(type(ret) is datetime.datetime)%0A%0A        # %25Y-%25m-%25dT%25H:%25M:%25S.%25fZ %3C 1900%0A        with self.assertRaises(ValueError):%0A            ret = utilities.datestring_to_datetime(%0A                %221777-01-01T23:59:59.999Z%22)%0A%0A        # %25Y-%25m-%25dT%25H:%25M:%25S good%0A        ret = utilities.datestring_to_datetime(%0A            %222019-01-01T23:59:59%22)%0A        self.assertTrue(ret)%0A        self.assertTrue(type(ret) is datetime.datetime)%0A%0A        # %25Y-%25m-%25dT%25H:%25M:%25S %3C 1900%0A        with self.assertRaises(ValueError):%0A            ret = utilities.datestring_to_datetime(%0A                %221777-01-01T23:59:59%22)%0A%0A        # %25Y-%25m-%25dT%25H:%25M:%25SZ good%0A        ret = utilities.datestring_to_datetime(%0A            %222019-01-01T23:59:59Z%22)%0A        self.assertTrue(ret)%0A        self.assertTrue(type(ret) is datetime.datetime)%0A%0A        # %25Y-%25m-%25dT%25H:%25M:%25SZ %3C 1900%0A        with self.assertRaises(ValueError):%0A            ret = utilities.datestring_to_datetime(%0A                %221777-01-01T23:59:59Z%22)%0A%0A        # already a datetime object%0A        ret1 = utilities.datestring_to_datetime(ret)%0A        self.assertEqual(ret1, ret)%0A%0A%0Aif __name__ == %22__main__%22:%0A    unittest.main()%0A

Add utilities test