本文整理汇总了Python中brain.Brain.create方法的典型用法代码示例。如果您正苦于以下问题:Python Brain.create方法的具体用法?Python Brain.create怎么用?Python Brain.create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类brain.Brain
的用法示例。
在下文中一共展示了Brain.create方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_saves_event_if_event_is_not_already_stored
# 需要导入模块: from brain import Brain [as 别名]
# 或者: from brain.Brain import create [as 别名]
def test_saves_event_if_event_is_not_already_stored(self):
Brain.create(self.event)
stored_event = Brain.read("223-unique-id")
assert stored_event.title == "Cool event"
assert stored_event.notification_sent == False
assert str(stored_event.date) == str(self.event.date)
assert str(stored_event.enrollment_date) == str(self.event.enrollment_date)
示例2: test_can_update_event
# 需要导入模块: from brain import Brain [as 别名]
# 或者: from brain.Brain import create [as 别名]
def test_can_update_event(self):
Brain.create(self.event)
self.event.title = "Updated event"
Brain.update(self.event)
assert Brain.read("223-unique-id").title == "Updated event"
示例3: test_rejects_event_if_event_is_already_stored
# 需要导入模块: from brain import Brain [as 别名]
# 或者: from brain.Brain import create [as 别名]
def test_rejects_event_if_event_is_already_stored(self):
Brain.create(self.event)
Brain.create(self.event)
assert len(Brain.all()) == 1
示例4: pull_events_from_feeds
# 需要导入模块: from brain import Brain [as 别名]
# 或者: from brain.Brain import create [as 别名]
def pull_events_from_feeds(self):
future_events = self.look_for_future_events()
for future_event in future_events:
Brain.create(future_event)