def setUp(self): eventDict = getEventDict() self.event = Event.from_dict(eventDict) self.refs_to_delete = list() self.cl = setup_scripts.SetUpTestDatabase() self.cl.clear_before() self.pl = setup_scripts.scripts.populate_locations.PopulateLocationCommand( ) self.refs_to_delete.extend(self.pl.execute()) self.fb_event = Event.from_dict(getEventDict(event_category="social"))
def setUp(self): self.refs_to_delete = list() event_dict = getEventDict(use_firestore_ref=True, to_earliest=1545033600, to_latest=1545119999, from_earliest=1545033600, from_latest=1545119999) self.event = Event.from_dict(event_dict) main.app.testing = True self.app = main.app.test_client() self.userId = "testuid1" self.c = scripts.SetUpTestDatabase() self.c.clear_before() self.c.generate_test_data(start_string="2018-12-17T08:00:00.000", num_days=5) # Populate location location_ref = event_dict["locationRef"] location_d = getLocationDict(location_category="social") location = Location.from_dict(location_d) LocationGenericDao().set(location, location_ref) self.refs_to_delete.append(location_ref) event_ref: firestore.DocumentReference = EventDao().create(self.event) self.event.set_firestore_ref(event_ref) self.refs_to_delete.append(event_ref) self.event_id = event_ref.id
def setUp(self): event_dict = store.getEventDict(event_category="social") event = Event.from_dict(event_dict) event_ref = EventDao().create(event) self.refs_to_delete.append(event_ref) self.event_id = event_ref.id d = store.EventRideRequestFormDictFactory().create( event_id=self.event_id, add_earliest_latest=True) self.user_id = 'testuserid1' self.builder: SocialEventRideRequestBuilder = \ SocialEventRideRequestBuilder().set_with_form_and_user_id(d, user_id=self.user_id)
def setUp(self): main.app.testing = True self.app = main.app.test_client() self.userIds = ["testuid1", "testuid2"] self.refs_to_delete = list() location_dict = store.getLocationDict(location_category="social") location = Location.from_dict(location_dict) location_ref = LocationGenericDao().insert_new(location) self.refs_to_delete.append(location_ref) event_dict = store.getEventDict(event_category="social") event_dict["locationRef"] = location_ref event = Event.from_dict(event_dict) event_ref = EventDao().create(event) self.refs_to_delete.append(event_ref) event_id = event_ref.id self.d = store.EventRideRequestFormDictFactory().create( event_id=event_id) self.ride_request_ids_to_delete = list()