def test_add_embargo_date_to_deposit_result(self, embargo): """ If an embargo is set, add to deposit record, otherwise not """ # We just set cleaned data directly f = Form() f.cleaned_data = dict() if embargo is not None: f.cleaned_data['embargo'] = embargo dr = DepositResult(status='pending') dr = self.protocol._add_embargo_date_to_deposit_result(dr, f) assert dr.embargo_date == embargo
def test_add_license_to_deposit_result(self, license_chooser): """ If a license is selected, add to deposit record, otherwise not """ # We just set the cleaned data directly f = Form() f.cleaned_data = dict() if license_chooser: f.cleaned_data['license'] = license_chooser dr = DepositResult(status='pending') dr = self.protocol._add_license_to_deposit_result(dr, f) if license_chooser: assert dr.license == license_chooser.license else: assert dr.license == None