Example #1
0
File: tests.py Project: urba1n/Kiwi
    def setUpTestData(cls):
        super(TestEnableDisableProperty, cls).setUpTestData()

        cls.permission = 'management.change_envproperty'
        cls.group_properties_url = reverse('mgmt-environment_properties')

        cls.tester = User.objects.create_user(  # nosec:B106:hardcoded_password_funcarg
            username='******',
            email='*****@*****.**',
            password='******')

        cls.group_nitrate = EnvGroupFactory(name='nitrate')

        cls.property_os = EnvPropertyFactory(name='OS')
        cls.property_lang = EnvPropertyFactory(name='lang')
        cls.disabled_property_1 = EnvPropertyFactory(
            name='disabled-property-1', is_active=False)
        cls.disabled_property_2 = EnvPropertyFactory(
            name='disabled-property-2', is_active=False)

        EnvGroupPropertyMapFactory(group=cls.group_nitrate,
                                   property=cls.property_os)
        EnvGroupPropertyMapFactory(group=cls.group_nitrate,
                                   property=cls.property_lang)
        EnvGroupPropertyMapFactory(group=cls.group_nitrate,
                                   property=cls.disabled_property_1)
        EnvGroupPropertyMapFactory(group=cls.group_nitrate,
                                   property=cls.disabled_property_2)
Example #2
0
    def setUpTestData(cls):
        super().setUpTestData()

        cls.group_url = reverse('mgmt-environment_groups')

        cls.group_1 = EnvGroupFactory(name='rhel-7',
                                      manager=cls.tester,
                                      modified_by=None)
        cls.group_2 = EnvGroupFactory(name='fedora',
                                      manager=cls.tester,
                                      modified_by=None)

        cls.group_1.log_action(who=cls.tester,
                               action='Add group {}'.format(cls.group_1.name))
        cls.group_1.log_action(who=cls.tester,
                               action='Edit group {}'.format(cls.group_1.name))
        cls.group_2.log_action(who=cls.tester,
                               action='Edit group {}'.format(cls.group_2.name))

        cls.property_1 = EnvPropertyFactory()
        cls.property_2 = EnvPropertyFactory()
        cls.property_3 = EnvPropertyFactory()

        EnvGroupPropertyMapFactory(group=cls.group_1, property=cls.property_1)
        EnvGroupPropertyMapFactory(group=cls.group_1, property=cls.property_2)
        EnvGroupPropertyMapFactory(group=cls.group_1, property=cls.property_3)

        EnvGroupPropertyMapFactory(group=cls.group_2, property=cls.property_1)
        EnvGroupPropertyMapFactory(group=cls.group_2, property=cls.property_3)
Example #3
0
File: tests.py Project: urba1n/Kiwi
    def setUpTestData(cls):
        super(TestVisitAndSearchGroupPage, cls).setUpTestData()

        cls.group_url = reverse('mgmt-environment_groups')

        cls.new_tester = User.objects.create_user(  # nosec:B106:hardcoded_password_funcarg
            username='******',
            email='*****@*****.**',
            password='******')

        cls.group_1 = EnvGroupFactory(name='rhel-7',
                                      manager=cls.new_tester,
                                      modified_by=None)
        cls.group_2 = EnvGroupFactory(name='fedora',
                                      manager=cls.new_tester,
                                      modified_by=None)

        cls.group_1.log_action(who=cls.new_tester,
                               action='Add group {}'.format(cls.group_1.name))
        cls.group_1.log_action(who=cls.new_tester,
                               action='Edit group {}'.format(cls.group_1.name))
        cls.group_2.log_action(who=cls.new_tester,
                               action='Edit group {}'.format(cls.group_2.name))

        cls.property_1 = EnvPropertyFactory()
        cls.property_2 = EnvPropertyFactory()
        cls.property_3 = EnvPropertyFactory()

        EnvGroupPropertyMapFactory(group=cls.group_1, property=cls.property_1)
        EnvGroupPropertyMapFactory(group=cls.group_1, property=cls.property_2)
        EnvGroupPropertyMapFactory(group=cls.group_1, property=cls.property_3)

        EnvGroupPropertyMapFactory(group=cls.group_2, property=cls.property_1)
        EnvGroupPropertyMapFactory(group=cls.group_2, property=cls.property_3)
Example #4
0
    def setUpTestData(cls):
        cls.product = ProductFactory()
        cls.request = HttpRequest()

        cls.info_objects = _InfoObjects(cls.request, cls.product.pk)

        cls.build_one = BuildFactory(product=cls.product)
        cls.build_two = BuildFactory(product=cls.product)
        cls.build_two.is_active = False
        cls.build_two.save()

        cls.category_one = CategoryFactory(product=cls.product)
        cls.category_two = CategoryFactory(product=cls.product)
        cls.category_three = CategoryFactory()

        cls.component_one = ComponentFactory(product=cls.product)
        cls.component_two = ComponentFactory(product=cls.product)
        cls.component_three = ComponentFactory()

        cls.env_group_one = EnvGroupFactory()
        cls.env_group_two = EnvGroupFactory()

        cls.env_property_one = EnvPropertyFactory()
        cls.env_property_two = EnvPropertyFactory()
        EnvGroupPropertyMapFactory(group=cls.env_group_one, property=cls.env_property_one)

        cls.env_value_one = EnvValueFactory(property=cls.env_property_one)
        cls.env_value_two = EnvValueFactory()

        cls.user_one = UserFactory()
        cls.user_two = UserFactory()

        cls.version_one = VersionFactory(product=cls.product)
        cls.version_two = VersionFactory()
Example #5
0
    def setUpTestData(cls):
        super().setUpTestData()

        user_should_have_perm(cls.tester, 'management.change_envgroup')

        cls.group_nitrate = EnvGroupFactory(name='nitrate')
        cls.duplicate_group = EnvGroupFactory(name='fedora')

        cls.property_1 = EnvPropertyFactory()
        cls.property_2 = EnvPropertyFactory()
        cls.property_3 = EnvPropertyFactory()

        cls.group_edit_url = reverse('mgmt-environment_group_edit')
Example #6
0
    def setUpTestData(cls):
        super(TestEditEnvironmentGroup, cls).setUpTestData()

        cls.tester = User.objects.create_user(username='******',
                                              email='*****@*****.**',
                                              password='******')
        user_should_have_perm(cls.tester, 'management.change_envgroup')

        cls.group_nitrate = EnvGroupFactory(name='nitrate', manager=cls.tester)
        cls.duplicate_group = EnvGroupFactory(name='fedora', manager=cls.tester)

        cls.property_1 = EnvPropertyFactory()
        cls.property_2 = EnvPropertyFactory()
        cls.property_3 = EnvPropertyFactory()

        cls.group_edit_url = reverse('mgmt-environment_group_edit')
Example #7
0
    def setUpTestData(cls):
        super().setUpTestData()

        cls.permission = 'management.add_envproperty'
        cls.group_properties_url = reverse('mgmt-environment_properties')

        cls.group_nitrate = EnvGroupFactory(name='nitrate', manager=cls.tester)
        cls.duplicate_property = EnvPropertyFactory(name='f26')
Example #8
0
    def setUpTestData(cls):
        super(TestGetObjectInfo, cls).setUpTestData()

        cls.get_info_url = reverse('ajax-info')

        cls.group_nitrate = EnvGroupFactory(name='nitrate')
        cls.group_new = EnvGroupFactory(name='NewGroup')

        cls.property_os = EnvPropertyFactory(name='os')
        cls.property_python = EnvPropertyFactory(name='python')
        cls.property_django = EnvPropertyFactory(name='django')

        EnvGroupPropertyMapFactory(group=cls.group_nitrate,
                                   property=cls.property_os)
        EnvGroupPropertyMapFactory(group=cls.group_nitrate,
                                   property=cls.property_python)
        EnvGroupPropertyMapFactory(group=cls.group_new,
                                   property=cls.property_django)
Example #9
0
    def setUpTestData(cls):
        super().setUpTestData()

        cls.group_url = reverse('mgmt-environment_groups')

        cls.group_1 = EnvGroupFactory(name='rhel-7')
        cls.group_2 = EnvGroupFactory(name='fedora')

        cls.property_1 = EnvPropertyFactory()
        cls.property_2 = EnvPropertyFactory()
        cls.property_3 = EnvPropertyFactory()

        EnvGroupPropertyMapFactory(group=cls.group_1, property=cls.property_1)
        EnvGroupPropertyMapFactory(group=cls.group_1, property=cls.property_2)
        EnvGroupPropertyMapFactory(group=cls.group_1, property=cls.property_3)

        EnvGroupPropertyMapFactory(group=cls.group_2, property=cls.property_1)
        EnvGroupPropertyMapFactory(group=cls.group_2, property=cls.property_3)
Example #10
0
    def setUpTestData(cls):
        super(TestEditProperty, cls).setUpTestData()

        cls.permission = 'management.change_envproperty'
        cls.group_properties_url = reverse('mgmt-environment_properties')

        cls.tester = User.objects.create_user(username='******',
                                              email='*****@*****.**',
                                              password='******')

        cls.property = EnvPropertyFactory(name='f26')
Example #11
0
    def setUpTestData(cls):
        super(TestAddProperty, cls).setUpTestData()

        cls.permission = 'management.add_envproperty'
        cls.group_properties_url = reverse('mgmt-environment_properties')

        cls.tester = User.objects.create_user(username='******',
                                              email='*****@*****.**',
                                              password='******')

        cls.group_nitrate = EnvGroupFactory(name='nitrate', manager=cls.tester)
        cls.duplicate_property = EnvPropertyFactory(name='f26')
Example #12
0
    def setUpTestData(cls):
        super().setUpTestData()

        cls.permission = 'management.change_envproperty'
        cls.group_properties_url = reverse('mgmt-environment_properties')

        cls.group_nitrate = EnvGroupFactory(name='nitrate')

        cls.property_os = EnvPropertyFactory(name='OS')
        cls.property_lang = EnvPropertyFactory(name='lang')
        cls.disabled_property_1 = EnvPropertyFactory(
            name='disabled-property-1', is_active=False)
        cls.disabled_property_2 = EnvPropertyFactory(
            name='disabled-property-2', is_active=False)

        EnvGroupPropertyMapFactory(group=cls.group_nitrate,
                                   property=cls.property_os)
        EnvGroupPropertyMapFactory(group=cls.group_nitrate,
                                   property=cls.property_lang)
        EnvGroupPropertyMapFactory(group=cls.group_nitrate,
                                   property=cls.disabled_property_1)
        EnvGroupPropertyMapFactory(group=cls.group_nitrate,
                                   property=cls.disabled_property_2)
Example #13
0
    def setUpTestData(cls):
        super(TestEnvValue, cls).setUpTestData()

        cls.property_os = EnvPropertyFactory(name='os')
        cls.value_linux = EnvValueFactory(value='Linux',
                                          property=cls.property_os)
        cls.value_bsd = EnvValueFactory(value='BSD', property=cls.property_os)
        cls.value_mac = EnvValueFactory(value='Mac', property=cls.property_os)

        cls.test_run.add_env_value(cls.value_linux)
        cls.test_run_1.add_env_value(cls.value_linux)

        cls.env_value_url = reverse('testruns-env_value')
        user_should_have_perm(cls.tester, 'testruns.add_envrunvaluemap')
        user_should_have_perm(cls.tester, 'testruns.delete_envrunvaluemap')
Example #14
0
    def setUpTestData(cls):
        super().setUpTestData()

        cls.permission = 'management.change_envproperty'
        cls.group_properties_url = reverse('mgmt-environment_properties')
        cls.property = EnvPropertyFactory(name='f26')