def get_params(self, offset_days=2): """ Create a dict of data to create a new event with the specified offset Args: offset_days: Returns: params for new event """ date = utils.local_now() + datetime.timedelta(days=offset_days + 2) event_date = "%d/%d/%d" % (date.month, date.day, date.year) params = { "start_date": event_date, "start_time_hour": "12", "start_time_minute": "0", "start_time_ampm": "PM", "end_date": event_date, "end_time_hour": "2", "end_time_minute": "0", "end_time_ampm": "PM", "setup": "15", "teardown": "15", "rooms": models.ROOM_OPTIONS[0][0], "details": "This is a test event.", "estimated_size": "10", "name": "Test Event", "type": "Meetup", } return params
def get_params(self, offset_days=1): """ Create a dict of data to create a new event with the specified offset Args: offset_days: Returns: params for new event """ date = utils.local_now() + datetime.timedelta(days=offset_days) event_date = "%d/%d/%d" % (date.month, date.day, date.year) params = { "start_date": event_date, "start_time_hour": "12", "start_time_minute": "0", "start_time_ampm": "PM", "end_date": event_date, "end_time_hour": "2", "end_time_minute": "0", "end_time_ampm": "PM", "setup": "15", "teardown": "15", "rooms": models.ROOM_OPTIONS[0][0], "details": "This is a test event.", "estimated_size": "10", "name": "Test Event", "type": "Meetup", } return params
def setUp(self): # Set up GAE testbed. self.testbed = testbed.Testbed() self.testbed.activate() self.testbed.init_datastore_v3_stub() self.testbed.init_user_stub() self.testbed.init_memcache_stub() self.testbed.init_taskqueue_stub() # Set up testing for application. self.test_app = webtest.TestApp(main.app) # Simulate a logged-in user. self.testbed.setup_env(user_email="*****@*****.**", user_is_admin="0", overwrite=True) # Default parameters for putting in the form. date = utils.local_now() + datetime.timedelta(days=1) event_date = "%d/%d/%d" % (date.month, date.day, date.year) self.params = { "start_date": event_date, "start_time_hour": "12", "start_time_minute": "0", "start_time_ampm": "PM", "end_date": event_date, "end_time_hour": "2", "end_time_minute": "0", "end_time_ampm": "PM", "setup": "15", "teardown": "15", "rooms": models.ROOM_OPTIONS[0][0], "details": "This is a test event.", "estimated_size": "10", "name": "Test Event", "type": "Meetup", } # Make a fake dictionary detailing a basic recurring event. self.recurring_data = { "frequency": "monthly", "repetitions": 5, "dayNumber": "1st", "monthDay": "Monday", "weekdaysOnly": False, }
def _make_events(self, events, offset=1, time=12): start = utils.local_now() + timedelta(days=2) start = start.replace(hour=time, minute=0) made_events = [] for i in range(0, events): start += datetime.timedelta(days=offset) event = models.Event(name="Test Event", start_time=start, end_time=start + datetime.timedelta(hours=1), type="Meetup", estimated_size="10", setup=15, teardown=15, details="This is a test event.", rooms=[models.ROOM_OPTIONS[0][0]]) event.put() made_events.append(event) return made_events
def _make_events(self, events, offset=1, time=12): start = utils.local_now() start = start.replace(hour=time, minute=0) made_events = [] for i in range(0, events): start += datetime.timedelta(days=offset) event = models.Event( name="Test Event", start_time=start, end_time=start + datetime.timedelta(hours=1), type="Meetup", estimated_size="10", setup=15, teardown=15, details="This is a test event.", rooms=[models.ROOM_OPTIONS[0][0]], ) event.put() made_events.append(event) return made_events