Fix an issue when creating scan job templates where we weren't obeying

the license flag, so folks could still create scan jobs even if they
weren't enabled by the license.  Plus Unit Tests
This commit is contained in:
Matthew Jones
2015-05-28 15:59:08 -04:00
parent 6709654e04
commit 5b3b4b48c0
4 changed files with 21 additions and 3 deletions

View File

@@ -173,14 +173,15 @@ class BaseTestMixin(QueueTestMixin, MockCommonlySlowTestMixin):
rnd_str = '____' + str(random.randint(1, 9999999))
return __name__ + '-generated-' + string + rnd_str
def create_test_license_file(self, instance_count=10000, license_date=int(time.time() + 3600)):
def create_test_license_file(self, instance_count=10000, license_date=int(time.time() + 3600), features=None):
writer = LicenseWriter(
company_name='AWX',
contact_name='AWX Admin',
contact_email='awx@example.com',
license_date=license_date,
instance_count=instance_count,
license_type='enterprise')
license_type='enterprise',
features=features)
handle, license_path = tempfile.mkstemp(suffix='.json')
os.close(handle)
writer.write_file(license_path)