def test_license(self): """Test getters and setters for license.""" mylicense = amo.LICENSE_MPL lic = License() lic.license_type = mylicense lic.save() eq_(lic.license_type, mylicense)
def test_builtin_text(self): """Get license text for all built-in licenses.""" lic = License() for licensetype in amo.LICENSES: lic.license_type = licensetype if not licensetype.shortname: assert not lic.text else: assert lic.text
def test_defaults(self): lic = License() lic.save() assert lic.is_custom, 'Custom license not recognized.' assert lic.license_type is amo.LICENSE_CUSTOM # default assert not lic.text lic.license_type = amo.LICENSE_MPL assert not lic.is_custom, 'Built-in license not recognized.' assert lic.text eq_(lic.url, amo.LICENSE_MPL.url)