def test_update(self): """ Tests update. """ usManager = UsManager() usManager.update_to = date(year=1948, month=1, day=1) self.assertEqual(usManager.getOldestDate(), date(year=1947, month=11, day=1)) usManager.update() count = FieldProduction.objects.count() self.assertEqual(count, 2) self.assertEqual(usManager.getOldestDate(), date(year=1947, month=12, day=1))
def updateUs(date=None): logger.info("Update Us task started.") usManager = UsManager() if date is not None: usManager.update_to = date return usManager.update()