Esempio n. 1
0
 def test_normalize_license(self):
     self.assertEqual(normalize_license(None), "UNKNOWN")
     self.assertEqual(
         normalize_license("""License :: OSI Approved :: MIT License
             """), "License :: OSI Approved :: MIT License")
     self.assertEqual(normalize_license("Pow" * 80), "Custom")
     self.assertEqual(normalize_license("MIT"), "MIT")
Esempio n. 2
0
 def test_normalize_license(self):
     self.assertEqual(normalize_license(None), "UNKNOWN")
     self.assertEqual(
         normalize_license("""License :: OSI Approved :: MIT License"""),
         "License :: OSI Approved :: MIT License"
     )
     self.assertEqual(normalize_license("Pow" * 80), "Custom")
     self.assertEqual(normalize_license("MIT"), "MIT")
Esempio n. 3
0
    def save(self, *args, **kwargs):
        self.license = normalize_license(self.license)

        # reset the latest_version cache on the package
        cache_name = self.package.cache_namer(self.package.last_released)
        cache.delete(cache_name)
        get_version(self.package)

        # reset the pypi_version cache on the package
        cache_name = self.package.cache_namer(self.package.pypi_version)
        cache.delete(cache_name)
        get_pypi_version(self.package)

        super(Version, self).save(*args, **kwargs)
Esempio n. 4
0
 def save(self, *args, **kwargs):
     self.license = normalize_license(self.license)
     super(Version, self).save(*args, **kwargs)
Esempio n. 5
0
 def save(self, *args, **kwargs):
     self.license = normalize_license(self.license)
     super(Version, self).save(*args, **kwargs)