本文整理匯總了Python中osf_tests.factories.DraftRegistrationFactory.datetime_updated方法的典型用法代碼示例。如果您正苦於以下問題:Python DraftRegistrationFactory.datetime_updated方法的具體用法?Python DraftRegistrationFactory.datetime_updated怎麽用?Python DraftRegistrationFactory.datetime_updated使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類osf_tests.factories.DraftRegistrationFactory
的用法示例。
在下文中一共展示了DraftRegistrationFactory.datetime_updated方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_queryset_returns_in_order_date_submitted
# 需要導入模塊: from osf_tests.factories import DraftRegistrationFactory [as 別名]
# 或者: from osf_tests.factories.DraftRegistrationFactory import datetime_updated [as 別名]
def test_queryset_returns_in_order_date_submitted(self):
created_first_submitted_second = DraftRegistrationFactory(
initiator=self.user,
registration_schema=self.schema,
registration_metadata=utils.SCHEMA_DATA
)
created_second_submitted_first = DraftRegistrationFactory(
initiator=self.user,
registration_schema=self.schema,
registration_metadata=utils.SCHEMA_DATA
)
nt.assert_greater(created_second_submitted_first.datetime_initiated, created_first_submitted_second.datetime_initiated)
created_second_submitted_first.submit_for_review(self.user, {}, save=True)
created_first_submitted_second.submit_for_review(self.user, {}, save=True)
created_second_submitted_first.datetime_updated = created_first_submitted_second.datetime_updated + datetime.timedelta(1)
assert created_second_submitted_first.datetime_updated > created_first_submitted_second.datetime_updated
res = list(self.view.get_queryset())
nt.assert_true(res[0] == created_first_submitted_second)