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()
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)