def test_get_from_date(self): persistence_mock = Mock() events_repo = EventsRepo(persistence=persistence_mock) events_repo.get_from_date('2019-10-01') persistence_mock.get_from_date.assert_called_once_with('2019-10-01')
def test_get_from_date_with_in_memory_repo(self): events_repo = EventsRepo(EventsInMemoryRepo()) events = events_repo.get_from_date('2019-10-16') self.assertEqual(str(events), 'zxcv 2019-10-16 07:05:30 entrada')