Skip to content

Commit

Permalink
Fix license test cleanup
Browse files Browse the repository at this point in the history
This fixes a test error with these two tests in combination:

    nosetests --ckan --with-pylons=test-core.ini  ckan/tests/model/test_license.py:TestLicenseRegister.test_import_v1_style_register_i18n ckan/tests/model/test_package.py:TestPackage.test_create
  • Loading branch information
David Read committed Jul 12, 2019
1 parent 27603fb commit 778833f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ckan/tests/model/test_license.py
Expand Up @@ -16,6 +16,12 @@ class TestLicenseRegister(object):
def setup(self):
helpers.reset_db()

def teardown(self):
# _license_register is cached, so clear it after tests that change the
# config['licenses_group_url']
from ckan import model
del model.Package._license_register

def test_default_register_has_basic_properties_of_a_license(self):
config['licenses_group_url'] = None
reg = LicenseRegister()
Expand Down

0 comments on commit 778833f

Please sign in to comment.