예제 #1
0
파일: tests.py 프로젝트: chowse/zamboni
    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)
예제 #2
0
파일: tests.py 프로젝트: chowse/zamboni
 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
예제 #3
0
파일: tests.py 프로젝트: chowse/zamboni
    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)