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


Python ObjectMother.get_microlocation方法代码示例

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


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

示例1: test_multiple_microlocation_for_same_event

# 需要导入模块: from tests.unittests.object_mother import ObjectMother [as 别名]
# 或者: from tests.unittests.object_mother.ObjectMother import get_microlocation [as 别名]
 def test_multiple_microlocation_for_same_event(self):
     microlocation1 = ObjectMother.get_microlocation()
     microlocation2 = Microlocation(name='test2',
                                    latitude=1.0,
                                    longitude=1.0,
                                    event_id=1)
     self.assertEqual(microlocation1.event_id, 1)
     self.assertEqual(microlocation2.event_id, 1)
开发者ID:ashishpahwa7,项目名称:open-event-orga-server,代码行数:10,代码来源:test_microlocation.py

示例2: test_event_view

# 需要导入模块: from tests.unittests.object_mother import ObjectMother [as 别名]
# 或者: from tests.unittests.object_mother.ObjectMother import get_microlocation [as 别名]
 def test_event_view(self):
     with app.test_request_context():
         event = ObjectMother.get_event()
         save_to_db(event, "Event saved")
         url = url_for('events.details_view', event_id=event.id)
         rv = self.app.get(url, follow_redirects=True)
         self.assertTrue("event1" in rv.data, msg=rv.data)
         microlocation = ObjectMother.get_microlocation(event_id=event.id)
         track = ObjectMother.get_track(event_id=event.id)
         cfs = ObjectMother.get_cfs(event_id=event.id)
         save_to_db(track, "Track saved")
         save_to_db(microlocation, "Microlocation saved")
         save_to_db(cfs, "Call for speakers saved")
         rv = self.app.get(url, follow_redirects=True)
         self.assertTrue("event1" in rv.data, msg=rv.data)
开发者ID:SaptakS,项目名称:open-event-orga-server,代码行数:17,代码来源:test_events.py

示例3: test_published_event_unpublished_schedule_view_attempt

# 需要导入模块: from tests.unittests.object_mother import ObjectMother [as 别名]
# 或者: from tests.unittests.object_mother.ObjectMother import get_microlocation [as 别名]
 def test_published_event_unpublished_schedule_view_attempt(self):
     with app.test_request_context():
         event = ObjectMother.get_event()
         event.state = 'Published'
         save_to_db(event, "Event Saved")
         track = ObjectMother.get_track()
         track.event_id = event.id
         save_to_db(track, "Track Saved")
         speaker = ObjectMother.get_speaker()
         speaker.event_id = event.id
         save_to_db(speaker, "Speaker Saved")
         microlocation = ObjectMother.get_microlocation()
         save_to_db(microlocation, "Microlocation Saved")
         session = ObjectMother.get_session()
         session.event_id = event.id
         session.microlocation_id = microlocation.id
         session.speakers = [speaker]
         save_to_db(speaker, "Session Saved")
         rv = self.app.get(url_for('event_detail.display_event_schedule', identifier=event.identifier),
                           follow_redirects=True)
         self.assertEqual(rv.status_code, 404)
开发者ID:ashishpahwa7,项目名称:open-event-orga-server,代码行数:23,代码来源:test_guest_event_page.py

示例4: test_published_event_schedule_view

# 需要导入模块: from tests.unittests.object_mother import ObjectMother [as 别名]
# 或者: from tests.unittests.object_mother.ObjectMother import get_microlocation [as 别名]
 def test_published_event_schedule_view(self):
     with app.test_request_context():
         event = ObjectMother.get_event()
         event.state = 'Published'
         event.schedule_published_on = datetime.now()
         save_to_db(event, "Event Saved")
         track = ObjectMother.get_track()
         track.event_id = event.id
         save_to_db(track, "Track Saved")
         speaker = ObjectMother.get_speaker()
         speaker.event_id = event.id
         save_to_db(speaker, "Speaker Saved")
         microlocation = ObjectMother.get_microlocation()
         save_to_db(microlocation, "Microlocation Saved")
         session = ObjectMother.get_session()
         session.event_id = event.id
         session.microlocation_id = microlocation.id
         session.speakers = [speaker]
         save_to_db(speaker, "Session Saved")
         rv = self.app.get(url_for('event_detail.display_event_schedule', identifier=event.identifier),
                           follow_redirects=True)
         self.assertTrue("Schedule" in rv.data, msg=rv.data)
开发者ID:ashishpahwa7,项目名称:open-event-orga-server,代码行数:24,代码来源:test_guest_event_page.py

示例5: test_add_microlocation_to_db

# 需要导入模块: from tests.unittests.object_mother import ObjectMother [as 别名]
# 或者: from tests.unittests.object_mother.ObjectMother import get_microlocation [as 别名]
 def test_add_microlocation_to_db(self):
     microlocation = ObjectMother.get_microlocation()
     with app.test_request_context():
         save_to_db(microlocation, "Microlocation saved")
         self.assertEqual(microlocation.id, 1)
         self.assertEqual(microlocation.event_id, 1)
开发者ID:ashishpahwa7,项目名称:open-event-orga-server,代码行数:8,代码来源:test_microlocation.py


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