diff --git a/src/app/tests.py b/src/app/tests.py index 3ae142d7..84ec4fd6 100644 --- a/src/app/tests.py +++ b/src/app/tests.py @@ -1146,11 +1146,10 @@ class SubmitNewLicenseViewsTestCase(TestCase): def initialise(self): self.fullname = "BSD Zero Clause License" self.shortIdentifier = "0BSD" - self.exampleUrl = "testUrl" self.sourceUrl = "http://landley.net/toybox/license.html" self.urls = [self.sourceUrl] self.osiApproved = "no" - self.comments = "Test Comment" + self.comments = "" self.notes = "" self.licenseHeader = "" self.text ='

Copyright (C) 2006 by Rob Landley <rob@landley.net>

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

' @@ -1161,7 +1160,7 @@ def initialise(self): self.data_no_author = {"fullname": self.fullname, "shortIdentifier": self.shortIdentifier, "sourceUrl": self.sourceUrl,'osiApproved': self.osiApproved, 'notes': self.notes, "licenseHeader": self.licenseHeader, "text": self.text, "userEmail": self.userEmail, - "urlType": "tests", "exampleUrl":self.exampleUrl,"comments":self.comments} + "urlType": "tests"} self.data = self.data_no_author.update({"licenseAuthorName": self.licenseAuthorName}) def test_submit_new_license(self): diff --git a/src/app/utils.py b/src/app/utils.py index 93d14b56..8d9d84f2 100644 --- a/src/app/utils.py +++ b/src/app/utils.py @@ -514,8 +514,8 @@ def check_spdx_license(licenseText): # if redis is empty build the spdx license list in the redis database if r.keys('*') == []: build_spdx_licenses() - spdxLicenseIds = list(map(lambda x: x.decode('utf-8'), list(r.keys()))) - spdxLicenseTexts = list(map(lambda x: x.decode('utf-8'), r.mget(spdxLicenseIds))) + spdxLicenseIds = list(r.keys()) + spdxLicenseTexts = r.mget(spdxLicenseIds) licenseData = dict(list(zip(spdxLicenseIds, spdxLicenseTexts))) matches = get_close_matches(licenseText, licenseData) if not matches: