當前位置: 首頁>>代碼示例>>Python>>正文


Python EventTestCreator.createFutureEvent方法代碼示例

本文整理匯總了Python中helpers.event.event_test_creator.EventTestCreator.createFutureEvent方法的典型用法代碼示例。如果您正苦於以下問題:Python EventTestCreator.createFutureEvent方法的具體用法?Python EventTestCreator.createFutureEvent怎麽用?Python EventTestCreator.createFutureEvent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在helpers.event.event_test_creator.EventTestCreator的用法示例。


在下文中一共展示了EventTestCreator.createFutureEvent方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: get

# 需要導入模塊: from helpers.event.event_test_creator import EventTestCreator [as 別名]
# 或者: from helpers.event.event_test_creator.EventTestCreator import createFutureEvent [as 別名]
 def get(self):
     if tba_config.CONFIG["env"] != "prod":
         EventTestCreator.createPastEvent()
         EventTestCreator.createFutureEvent()
         EventTestCreator.createPresentEvent()
         self.redirect("/events/")
     else:
         logging.error("{} tried to create test events in prod! No can do.".format(
             users.get_current_user().email()))
         self.redirect("/admin/")
開發者ID:pyprogrammer,項目名稱:the-blue-alliance,代碼行數:12,代碼來源:admin_event_controller.py

示例2: get

# 需要導入模塊: from helpers.event.event_test_creator import EventTestCreator [as 別名]
# 或者: from helpers.event.event_test_creator.EventTestCreator import createFutureEvent [as 別名]
    def get(self):
        self._require_admin()

        if tba_config.CONFIG["env"] != "prod":
            EventTestCreator.createPastEvent()
            EventTestCreator.createFutureEvent()
            EventTestCreator.createPresentEvent()
            self.redirect("/events/")
        else:
            logging.error("{} tried to create test events in prod! No can do.".format(
                self.user_bundle.user.email()))
            self.redirect("/admin/")
開發者ID:technonerdz,項目名稱:the-blue-alliance,代碼行數:14,代碼來源:admin_event_controller.py

示例3: setUp

# 需要導入模塊: from helpers.event.event_test_creator import EventTestCreator [as 別名]
# 或者: from helpers.event.event_test_creator.EventTestCreator import createFutureEvent [as 別名]
    def setUp(self):
        self.testbed = testbed.Testbed()
        self.testbed.activate()
        self.testbed.init_datastore_v3_stub()
        self.testbed.init_memcache_stub()
        self.testbed.init_taskqueue_stub(root_path=".")

        self.future_event = EventTestCreator.createFutureEvent(only_event=True)
        self.present_event = EventTestCreator.createPresentEvent(only_event=True)
        self.past_event = EventTestCreator.createPastEvent(only_event=True)
        self.event_starts_today = Event(
            id="{}teststartstoday".format(datetime.datetime.now().year),
            end_date=datetime.datetime.today() + datetime.timedelta(days=2),
            event_short="teststartstoday",
            event_type_enum=EventType.REGIONAL,
            first_eid="5561",
            name="Test Event (Starts Today)",
            start_date=datetime.datetime.today(),
            year=datetime.datetime.now().year,
            venue_address="123 Fake Street, California, USA",
            website="http://www.google.com"
        )
        self.event_ends_today = Event(
            id="{}testendstoday".format(datetime.datetime.now().year),
            end_date=datetime.datetime.today(),
            event_short="testendstoday",
            event_type_enum=EventType.REGIONAL,
            first_eid="5561",
            name="Test Event (Ends Today)",
            start_date=datetime.datetime.today() - datetime.timedelta(days=2),
            year=datetime.datetime.now().year,
            venue_address="123 Fake Street, California, USA",
            website="http://www.google.com"
        )
開發者ID:CarterFendley,項目名稱:the-blue-alliance,代碼行數:36,代碼來源:test_event.py

示例4: setUp

# 需要導入模塊: from helpers.event.event_test_creator import EventTestCreator [as 別名]
# 或者: from helpers.event.event_test_creator.EventTestCreator import createFutureEvent [as 別名]
    def setUp(self):
        self.testbed = testbed.Testbed()
        self.testbed.activate()
        self.testbed.init_datastore_v3_stub()
        self.testbed.init_memcache_stub()

        self.future_event = EventTestCreator.createFutureEvent(only_event=True)
        self.present_event = EventTestCreator.createPresentEvent(only_event=True)
        self.past_event = EventTestCreator.createPastEvent(only_event=True)
開發者ID:Captain-Dude,項目名稱:the-blue-alliance,代碼行數:11,代碼來源:test_event.py

示例5: test_creates

# 需要導入模塊: from helpers.event.event_test_creator import EventTestCreator [as 別名]
# 或者: from helpers.event.event_test_creator.EventTestCreator import createFutureEvent [as 別名]
 def test_creates(self):
     self.events.append(EventTestCreator.createPastEvent())
     self.events.append(EventTestCreator.createFutureEvent())
     self.events.append(EventTestCreator.createPresentEvent())
開發者ID:MC42,項目名稱:the-blue-alliance,代碼行數:6,代碼來源:test_event_test_creator.py

示例6: setUp

# 需要導入模塊: from helpers.event.event_test_creator import EventTestCreator [as 別名]
# 或者: from helpers.event.event_test_creator.EventTestCreator import createFutureEvent [as 別名]
    def setUp(self):
        self.testbed = testbed.Testbed()
        self.testbed.activate()
        self.testbed.init_datastore_v3_stub()
        self.testbed.init_memcache_stub()
        ndb.get_context().clear_cache()  # Prevent data from leaking between tests

        self.testbed.init_taskqueue_stub(root_path=".")

        self.future_event = EventTestCreator.createFutureEvent(only_event=True)
        self.present_event = EventTestCreator.createPresentEvent(only_event=True)
        self.past_event = EventTestCreator.createPastEvent(only_event=True)
        self.event_starts_today = Event(
            id="{}teststartstoday".format(datetime.datetime.now().year),
            end_date=datetime.datetime.today() + datetime.timedelta(days=2),
            event_short="teststartstoday",
            event_type_enum=EventType.REGIONAL,
            first_eid="5561",
            name="Test Event (Starts Today)",
            start_date=datetime.datetime.today(),
            year=datetime.datetime.now().year,
            venue_address="123 Fake Street, California, USA",
            website="http://www.google.com"
        )
        self.event_ends_today = Event(
            id="{}testendstoday".format(datetime.datetime.now().year),
            end_date=datetime.datetime.today(),
            event_short="testendstoday",
            event_type_enum=EventType.REGIONAL,
            first_eid="5561",
            name="Test Event (Ends Today)",
            start_date=datetime.datetime.today() - datetime.timedelta(days=2),
            year=datetime.datetime.now().year,
            venue_address="123 Fake Street, California, USA",
            website="http://www.google.com"
        )
        self.event_starts_tomorrow = Event(
            id="{}teststartstomorrow".format(datetime.datetime.now().year),
            end_date=datetime.datetime.today() + datetime.timedelta(days=3),
            event_short="teststartstomorrow",
            event_type_enum=EventType.REGIONAL,
            first_eid="5561",
            name="Test Event (Starts Tomorrow)",
            start_date=datetime.datetime.today() + datetime.timedelta(days=1),
            year=datetime.datetime.now().year,
            venue_address="123 Fake Street, California, USA",
            website="http://www.google.com"
        )
        self.event_starts_tomorrow_tz = Event(
            id="{}teststartstomorrow".format(datetime.datetime.now().year),
            end_date=datetime.datetime.today() + datetime.timedelta(days=3),
            event_short="teststartstomorrow",
            event_type_enum=EventType.REGIONAL,
            first_eid="5561",
            name="Test Event (Starts Tomorrow)",
            start_date=datetime.datetime.today() + datetime.timedelta(days=1),
            year=datetime.datetime.now().year,
            venue_address="123 Fake Street, California, USA",
            website="http://www.google.com",
            timezone_id="America/New_York",
        )
開發者ID:MC42,項目名稱:the-blue-alliance,代碼行數:63,代碼來源:test_event.py


注:本文中的helpers.event.event_test_creator.EventTestCreator.createFutureEvent方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。