예제 #1
0
 def test_startup_created_no_created_datetime(self):
     startup = StartupFactory(created_datetime=None)
     startup.created_at = None
     startup.save()
     with self.login(email=self.basic_user().email):
         url = reverse(OrganizationHistoryView.view_name,
                       args=[startup.organization.id])
         response = self.client.get(url)
         events = find_events(response.data["results"],
                              OrganizationCreatedEvent.EVENT_TYPE)
         self.assertEqual(1, len(events))
         self.assertEqual(DAWN_OF_TIME, events[0]["datetime"])
예제 #2
0
 def test_startup_created_using_other_startups(self):
     prev_created_datetime = days_from_now(-10)
     StartupFactory(created_datetime=prev_created_datetime)
     startup = StartupFactory(created_datetime=None)
     startup.created_at = None
     startup.save()
     next_created_datetime = days_from_now(-2)
     StartupFactory(created_datetime=next_created_datetime)
     with self.login(email=self.basic_user().email):
         url = reverse(OrganizationHistoryView.view_name,
                       args=[startup.organization.id])
         response = self.client.get(url)
         events = find_events(response.data["results"],
                              OrganizationCreatedEvent.EVENT_TYPE)
         self.assertEqual(1, len(events))
         self.assertEqual(prev_created_datetime, events[0]["datetime"])
         self.assertEqual(next_created_datetime,
                          events[0]["latest_datetime"])