当前位置: 首页>>代码示例>>Python>>正文


Python ObjectMother.get_event方法代码示例

本文整理汇总了Python中tests.object_mother.ObjectMother.get_event方法的典型用法代码示例。如果您正苦于以下问题:Python ObjectMother.get_event方法的具体用法?Python ObjectMother.get_event怎么用?Python ObjectMother.get_event使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在tests.object_mother.ObjectMother的用法示例。


在下文中一共展示了ObjectMother.get_event方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_speakers_list

# 需要导入模块: from tests.object_mother import ObjectMother [as 别名]
# 或者: from tests.object_mother.ObjectMother import get_event [as 别名]
 def test_speakers_list(self):
     with app.test_request_context():
         event = ObjectMother.get_event()
         save_to_db(event, "Event saved")
         url = url_for('event_speakers.index_view', event_id=event.id)
         rv = self.app.get(url, follow_redirects=True)
         self.assertTrue("Speakers" in rv.data, msg=rv.data)
开发者ID:agwisniewska,项目名称:open-event-orga-server,代码行数:9,代码来源:test_speakers.py

示例2: test_event_copy

# 需要导入模块: from tests.object_mother import ObjectMother [as 别名]
# 或者: from tests.object_mother.ObjectMother import get_event [as 别名]
 def test_event_copy(self):
     with app.test_request_context():
         event = ObjectMother.get_event()
         save_to_db(event, "Event saved")
         url = url_for('events.copy_event', event_id=event.id)
         rv = self.app.get(url, follow_redirects=True)
         self.assertTrue("Copy of event1" in rv.data, msg=rv.data)
开发者ID:agwisniewska,项目名称:open-event-orga-server,代码行数:9,代码来源:test_events.py

示例3: test_events_edit

# 需要导入模块: from tests.object_mother import ObjectMother [as 别名]
# 或者: from tests.object_mother.ObjectMother import get_event [as 别名]
 def test_events_edit(self):
     with app.test_request_context():
         event = ObjectMother.get_event()
         save_to_db(event, "Event saved")
         custom_forms = ObjectMother.get_custom_form(event.id)
         save_to_db(custom_forms, "Custom forms saved")
         url = url_for('events.edit_view', event_id=event.id)
         data = POST_EVENT_DATA.copy()
         del data['copyright']
         data['sponsors[name]'] = ['Sponsor 1', 'Sponsor 2']
         data['sponsors[type]'] = ['Gold', 'Silver']
         data['sponsors[url]'] = ["", ""]
         data['sponsors[description]'] = ["", ""]
         data['sponsors[level]'] = ["", ""]
         data['name'] = 'EditTestName'
         data['start_date'] = '07/04/2016'
         data['start_time'] = '19:00'
         data['end_date'] = '07/04/2016'
         data['end_time'] = '22:00'
         data['custom_form[name]'] = ['session_form', 'speaker_form']
         data['custom_form[value]'] = [custom_forms.session_form, custom_forms.speaker_form]
         data = ImmutableMultiDict(data)
         rv = self.app.post(url, follow_redirects=True, buffered=True, content_type='multipart/form-data',
                            data=data)
         self.assertTrue('EditTestName' in rv.data, msg=rv.data)
         self.assertTrue(data['sponsors[name]'] in rv.data, msg=rv.data)
开发者ID:agwisniewska,项目名称:open-event-orga-server,代码行数:28,代码来源:test_events.py

示例4: test_wrong_form_config

# 需要导入模块: from tests.object_mother import ObjectMother [as 别名]
# 或者: from tests.object_mother.ObjectMother import get_event [as 别名]
 def test_wrong_form_config(self):
     with app.test_request_context():
         event = ObjectMother.get_event()
         save_to_db(event, "Event saved")
         url = url_for('event_sessions.create_view', event_id=event.id)
         rv = self.app.get(url, follow_redirects=True)
         self.assertFalse("incorrectly configured" in rv.data, msg=rv.data)
开发者ID:hacktrec,项目名称:open-event-orga-server,代码行数:9,代码来源:test_session.py

示例5: test_event_delete

# 需要导入模块: from tests.object_mother import ObjectMother [as 别名]
# 或者: from tests.object_mother.ObjectMother import get_event [as 别名]
 def test_event_delete(self):
     with app.test_request_context():
         event = ObjectMother.get_event()
         save_to_db(event, "Event saved")
         url = url_for('events.trash_view', event_id=event.id)
         rv = self.app.get(url, follow_redirects=True)
         self.assertTrue("Your event has been deleted" in rv.data, msg=rv.data)
开发者ID:agwisniewska,项目名称:open-event-orga-server,代码行数:9,代码来源:test_events.py

示例6: test_scheduler_publish

# 需要导入模块: from tests.object_mother import ObjectMother [as 别名]
# 或者: from tests.object_mother.ObjectMother import get_event [as 别名]
 def test_scheduler_publish(self):
     with app.test_request_context():
         event = ObjectMother.get_event()
         save_to_db(event, "Event saved")
         rv = self.app.get(url_for('event_scheduler.publish', event_id=event.id), follow_redirects=True)
         event = DataGetter.get_event(event.id)
         self.assertTrue(event.schedule_published_on is not None, msg=rv.data)
开发者ID:agwisniewska,项目名称:open-event-orga-server,代码行数:9,代码来源:test_scheduler.py

示例7: test_unpublished_event_view_attempt

# 需要导入模块: from tests.object_mother import ObjectMother [as 别名]
# 或者: from tests.object_mother.ObjectMother import get_event [as 别名]
 def test_unpublished_event_view_attempt(self):
     with app.test_request_context():
         event = ObjectMother.get_event()
         save_to_db(event, "Event Saved")
         rv = self.app.get(url_for('event_detail.display_event_detail_home', event_id=event.id),
                           follow_redirects=True)
         self.assertEqual(rv.status_code, 404)
开发者ID:agwisniewska,项目名称:open-event-orga-server,代码行数:9,代码来源:test_guest_event_page.py

示例8: test_published_event_view_coc

# 需要导入模块: from tests.object_mother import ObjectMother [as 别名]
# 或者: from tests.object_mother.ObjectMother import get_event [as 别名]
 def test_published_event_view_coc(self):
     with app.test_request_context():
         event = ObjectMother.get_event()
         event.state = 'Published'
         save_to_db(event, "Event Saved")
         rv = self.app.get(url_for('event_detail.display_event_coc', event_id=event.id),
                           follow_redirects=True)
         self.assertTrue("Code of Conduct" in rv.data, msg=rv.data)
开发者ID:agwisniewska,项目名称:open-event-orga-server,代码行数:10,代码来源:test_guest_event_page.py

示例9: test_event_publish

# 需要导入模块: from tests.object_mother import ObjectMother [as 别名]
# 或者: from tests.object_mother.ObjectMother import get_event [as 别名]
 def test_event_publish(self):
     with app.test_request_context():
         event = ObjectMother.get_event()
         save_to_db(event, "Event saved")
         url = url_for('events.publish_event', event_id=event.id)
         rv = self.app.get(url, follow_redirects=True)
         event = DataGetter.get_event(event.id)
         self.assertEqual("Published", event.state, msg=event.state)
开发者ID:agwisniewska,项目名称:open-event-orga-server,代码行数:10,代码来源:test_events.py

示例10: get_event

# 需要导入模块: from tests.object_mother import ObjectMother [as 别名]
# 或者: from tests.object_mother.ObjectMother import get_event [as 别名]
def get_event():
    event = ObjectMother.get_event()
    event.name = 'Super Event'
    event.start_time = datetime.now() + timedelta(days=5)
    event.end_time = event.start_time + timedelta(days=5)
    event.location_name = 'India'
    event.state = 'Published'
    return event
开发者ID:agwisniewska,项目名称:open-event-orga-server,代码行数:10,代码来源:test_search.py

示例11: test_api_tracks

# 需要导入模块: from tests.object_mother import ObjectMother [as 别名]
# 或者: from tests.object_mother.ObjectMother import get_event [as 别名]
 def test_api_tracks(self):
     self.assertEqual(self.app.get('/api/v1/event/1').status_code, 404)
     event = ObjectMother.get_event()
     track = ObjectMother.get_track()
     with app.test_request_context():
         save_to_db(event, "Event saved")
         save_to_db(track, "Track saved")
     self.assertEqual(self.app.get('/api/v1/event/1').status_code, 200)
     self.assertEqual(self.app.get('/api/v1/event/1/tracks').status_code, 200)
开发者ID:hacktrec,项目名称:open-event-orga-server,代码行数:11,代码来源:test_api.py

示例12: test_event_delete

# 需要导入模块: from tests.object_mother import ObjectMother [as 别名]
# 或者: from tests.object_mother.ObjectMother import get_event [as 别名]
 def test_event_delete(self):
     with app.test_request_context():
         event = ObjectMother.get_event()
         register(self.app, u'[email protected]', u'test2')
         login(self.app, '[email protected]', 'test2')
         save_to_db(event, "Event saved")
         url = url_for('events.delete_view', event_id=event.id)
         rv = self.app.get(url, follow_redirects=True)
         self.assertTrue("Forbidden" in rv.data, msg=rv.data)
开发者ID:faheemzunjani,项目名称:open-event-orga-server,代码行数:11,代码来源:test_event_functions.py

示例13: test_published_event_view

# 需要导入模块: from tests.object_mother import ObjectMother [as 别名]
# 或者: from tests.object_mother.ObjectMother import get_event [as 别名]
 def test_published_event_view(self):
     with app.test_request_context():
         event = ObjectMother.get_event()
         event.state = "Published"
         save_to_db(event, "Event Saved")
         rv = self.app.get(
             url_for("event_detail.display_event_detail_home", event_id=event.id), follow_redirects=True
         )
         self.assertTrue("Open Event" in rv.data, msg=rv.data)
开发者ID:yasharmaster,项目名称:open-event-orga-server,代码行数:11,代码来源:test_guest_event_page.py

示例14: test_session_reject

# 需要导入模块: from tests.object_mother import ObjectMother [as 别名]
# 或者: from tests.object_mother.ObjectMother import get_event [as 别名]
 def test_session_reject(self):
     with app.test_request_context():
         event = ObjectMother.get_event()
         save_to_db(event, "Event Saved")
         session = ObjectMother.get_session()
         save_to_db(session, "Session Saved")
         url = url_for('event_sessions.reject_session', event_id=1, session_id=session.id)
         rv = self.app.get(url, follow_redirects=True)
         self.assertTrue("The session has been rejected" in rv.data, msg=rv.data)
开发者ID:hacktrec,项目名称:open-event-orga-server,代码行数:11,代码来源:test_session.py

示例15: setUp

# 需要导入模块: from tests.object_mother import ObjectMother [as 别名]
# 或者: from tests.object_mother.ObjectMother import get_event [as 别名]
 def setUp(self):
     self.app = Setup.create_app()
     with app.test_request_context():
         event = ObjectMother.get_event()
         event.owner = 1
         track = ObjectMother.get_track()
         save_to_db(event,"Event saved")
         save_to_db(track, "Track saved")
         register(self.app,'test', '[email protected]', 'test')
开发者ID:championswimmer,项目名称:open-event-orga-server,代码行数:11,代码来源:test_event_track.py


注:本文中的tests.object_mother.ObjectMother.get_event方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。