From d35259c80714c3f117d3ee1331a87cfb3a720abf Mon Sep 17 00:00:00 2001 From: Chris Meyers Date: Fri, 22 May 2015 15:39:40 -0400 Subject: [PATCH 1/2] create enterprise license in tests --- awx/main/tests/base.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/awx/main/tests/base.py b/awx/main/tests/base.py index 10b350d743..f98fdef2dc 100644 --- a/awx/main/tests/base.py +++ b/awx/main/tests/base.py @@ -179,7 +179,8 @@ class BaseTestMixin(QueueTestMixin, MockCommonlySlowTestMixin): contact_name='AWX Admin', contact_email='awx@example.com', license_date=license_date, - instance_count=instance_count) + instance_count=instance_count, + license_type='enterprise') handle, license_path = tempfile.mkstemp(suffix='.json') os.close(handle) writer.write_file(license_path) From 17500859f4bf4e3aaa6f84c458be6a62cc06818a Mon Sep 17 00:00:00 2001 From: Chris Meyers Date: Fri, 22 May 2015 16:48:32 -0400 Subject: [PATCH 2/2] add license creation to tests --- awx/main/tests/activity_stream.py | 2 ++ awx/main/tests/ad_hoc.py | 2 ++ awx/main/tests/jobs/jobs_monolithic.py | 2 ++ awx/main/tests/organizations.py | 2 ++ 4 files changed, 8 insertions(+) diff --git a/awx/main/tests/activity_stream.py b/awx/main/tests/activity_stream.py index 8451671f51..c6a176a536 100644 --- a/awx/main/tests/activity_stream.py +++ b/awx/main/tests/activity_stream.py @@ -19,6 +19,8 @@ class ActivityStreamTest(BaseTest): def setUp(self): super(ActivityStreamTest, self).setUp() self.setup_instances() + self.create_test_license_file() + # TODO: Test non-enterprise license self.setup_users() self.org_created = self.post(reverse('api:organization_list'), dict(name='test org', description='test descr'), expect=201, auth=self.get_super_credentials()) diff --git a/awx/main/tests/ad_hoc.py b/awx/main/tests/ad_hoc.py index 45e0c095e7..957cd7c084 100644 --- a/awx/main/tests/ad_hoc.py +++ b/awx/main/tests/ad_hoc.py @@ -911,6 +911,8 @@ class AdHocCommandApiTest(BaseAdHocCommandTest): @mock.patch('awx.main.tasks.BaseTask.run_pexpect', side_effect=run_pexpect_mock) def test_ad_hoc_command_activity_stream(self, ignore): + # TODO: Test non-enterprise license + self.create_test_license_file() with self.current_user('admin'): response = self.run_test_ad_hoc_command() diff --git a/awx/main/tests/jobs/jobs_monolithic.py b/awx/main/tests/jobs/jobs_monolithic.py index 6002e1ddd4..559b952e14 100644 --- a/awx/main/tests/jobs/jobs_monolithic.py +++ b/awx/main/tests/jobs/jobs_monolithic.py @@ -1020,6 +1020,8 @@ class JobTransactionTest(BaseJobTestMixin, django.test.LiveServerTestCase): class JobTemplateSurveyTest(BaseJobTestMixin, django.test.TestCase): def setUp(self): super(JobTemplateSurveyTest, self).setUp() + # TODO: Test non-enterprise license + self.create_test_license_file() def tearDown(self): super(JobTemplateSurveyTest, self).tearDown() diff --git a/awx/main/tests/organizations.py b/awx/main/tests/organizations.py index 0ee735a2ca..0cd0108ee2 100644 --- a/awx/main/tests/organizations.py +++ b/awx/main/tests/organizations.py @@ -13,6 +13,8 @@ class OrganizationsTest(BaseTest): def setUp(self): super(OrganizationsTest, self).setUp() self.setup_instances() + # TODO: Test non-enterprise license + self.create_test_license_file() self.setup_users() self.organizations = self.make_organizations(self.super_django_user, 10)