mirror of
https://github.com/ansible/awx.git
synced 2024-10-31 23:51:09 +03:00
Updating tests around data preload
This commit is contained in:
parent
d1801bdf9f
commit
ba7f48abf1
@ -191,32 +191,23 @@ class CreateDefaultOrgTest(BaseCommandMixin, BaseTest):
|
||||
|
||||
def setUp(self):
|
||||
super(CreateDefaultOrgTest, self).setUp()
|
||||
self.setup_instances()
|
||||
|
||||
def test_create_default_org(self):
|
||||
self.setup_users()
|
||||
self.assertEqual(Organization.objects.count(), 0)
|
||||
result, stdout, stderr = self.run_command('create_default_org')
|
||||
result, stdout, stderr = self.run_command('create_preload_data')
|
||||
self.assertEqual(result, None)
|
||||
self.assertTrue('Default organization added' in stdout)
|
||||
self.assertEqual(Organization.objects.count(), 1)
|
||||
org = Organization.objects.all()[0]
|
||||
self.assertEqual(org.created_by, self.super_django_user)
|
||||
self.assertEqual(org.modified_by, self.super_django_user)
|
||||
result, stdout, stderr = self.run_command('create_default_org')
|
||||
result, stdout, stderr = self.run_command('create_preload_data')
|
||||
self.assertEqual(result, None)
|
||||
self.assertFalse('Default organization added' in stdout)
|
||||
self.assertEqual(Organization.objects.count(), 1)
|
||||
|
||||
def test_create_default_org_when_no_superuser_exists(self):
|
||||
self.assertEqual(Organization.objects.count(), 0)
|
||||
result, stdout, stderr = self.run_command('create_default_org')
|
||||
self.assertEqual(result, None)
|
||||
self.assertTrue('Default organization added' in stdout)
|
||||
self.assertEqual(Organization.objects.count(), 1)
|
||||
org = Organization.objects.all()[0]
|
||||
self.assertEqual(org.created_by, None)
|
||||
self.assertEqual(org.modified_by, None)
|
||||
|
||||
class DumpDataTest(BaseCommandMixin, BaseTest):
|
||||
'''
|
||||
Test cases for dumpdata management command.
|
||||
|
Loading…
Reference in New Issue
Block a user