Exemple #1
0
 def test_wrap_datetime_min(self):
     schema_bad = ExportSchema(
         schema={},
         timestamp=datetime.min,
         index='index',
     )
     schema_good = ExportSchema.wrap(schema_bad.to_json())
     self.assertEqual(schema_good.timestamp, datetime(1970, 1, 1))
Exemple #2
0
 def test_wrap_datetime_min(self):
     schema_bad = ExportSchema(
         schema={},
         timestamp=datetime.min,
         index='index',
     )
     schema_good = ExportSchema.wrap(schema_bad.to_json())
     self.assertEqual(schema_good.timestamp, datetime(1970, 1, 1))
Exemple #3
0
 def test_wrap_datetime_hippy(self):
     schema1 = ExportSchema(
         schema={},
         timestamp=datetime(1970, 1, 2),
         index='index',
     )
     schema2 = ExportSchema.wrap(schema1.to_json())
     self.assertEqual(schema2.timestamp, datetime(1970, 1, 2))
Exemple #4
0
 def test_wrap_datetime_hippy(self):
     schema1 = ExportSchema(
         schema={},
         timestamp=datetime(1970, 1, 2),
         index='index',
     )
     schema2 = ExportSchema.wrap(schema1.to_json())
     self.assertEqual(schema2.timestamp, datetime(1970, 1, 2))