本文整理汇总了Python中the_tale.common.postponed_tasks.prototypes.PostponedTaskPrototype.save方法的典型用法代码示例。如果您正苦于以下问题:Python PostponedTaskPrototype.save方法的具体用法?Python PostponedTaskPrototype.save怎么用?Python PostponedTaskPrototype.save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类the_tale.common.postponed_tasks.prototypes.PostponedTaskPrototype
的用法示例。
在下文中一共展示了PostponedTaskPrototype.save方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_fast_registration_second_request_after_error
# 需要导入模块: from the_tale.common.postponed_tasks.prototypes import PostponedTaskPrototype [as 别名]
# 或者: from the_tale.common.postponed_tasks.prototypes.PostponedTaskPrototype import save [as 别名]
def test_fast_registration_second_request_after_error(self):
response = self.client.post(reverse('accounts:registration:fast'))
task = PostponedTaskPrototype(model=PostponedTask.objects.all()[0])
task.state = POSTPONED_TASK_STATE.ERROR
task.save()
response = self.client.post(reverse('accounts:registration:fast'))
task_2 = PostponedTaskPrototype(model=PostponedTask.objects.all()[1])
self.check_ajax_processing(response, task_2.status_url)
self.assertEqual(PostponedTask.objects.all().count(), 2)
task_2.state = POSTPONED_TASK_STATE.ERROR
task_2.save()
response = self.client.post(reverse('accounts:registration:fast'))
task_3 = PostponedTaskPrototype(model=PostponedTask.objects.all()[2])
self.check_ajax_processing(response, task_3.status_url)
self.assertEqual(PostponedTask.objects.all().count(), 3)
task_3.remove()
response = self.client.post(reverse('accounts:registration:fast'))
task_4 = PostponedTaskPrototype(model=PostponedTask.objects.all()[2])
self.check_ajax_processing(response, task_4.status_url)
self.assertEqual(PostponedTask.objects.all().count(), 3)