コード例 #1
0
 def registration(self, user):
     end_date = timezone.now() + datetime.timedelta(
         days=3)  # embargo days must be 3 days in the future
     embargo = EmbargoFactory(end_date=end_date)
     embargo.state = Sanction.APPROVED
     embargo.save()
     return embargo.registrations.last()
コード例 #2
0
ファイル: test_embargoes.py プロジェクト: leb2dg/osf.io
 def test_state_can_be_set_to_complete(self):
     embargo = EmbargoFactory()
     embargo.state = Embargo.COMPLETED
     embargo.save()  # should pass validation
     assert_equal(embargo.state, Embargo.COMPLETED)
コード例 #3
0
 def test_state_can_be_set_to_complete(self):
     embargo = EmbargoFactory()
     embargo.state = Embargo.COMPLETED
     embargo.save()  # should pass validation
     assert_equal(embargo.state, Embargo.COMPLETED)