def test_is_exported(self): self.assertTrue(self.observation.is_exported) self.observation.is_exported = False self.assertFalse(self.observation.is_exported) self.observation.is_exported = True self.assertTrue(self.observation.is_exported) observation = Observation() self.assertFalse(observation.is_exported) observation.is_exported = True self.assertTrue(observation.is_exported)
def test_export_date(self): self.observation.is_exported = False self.assertIsNone(self.observation.export_date) now = datetime.now().astimezone().replace(microsecond=0) self.observation.is_exported = True self.observation.export_date = now self.assertEqual(now, self.observation.export_date) observation = Observation() observation.export_date = now observation.is_exported = True self.assertEqual(now, observation.export_date)