示例#1
0
    def test_negative_create_with_invalid_username(self):
        """Create User with invalid Username

        :id: 8bb53001-6377-49fe-a85c-f92204a5dea4

        :expectedresults: User is not created. Appropriate error shown.

        :CaseImportance: Critical
        """
        invalid_names = (
            '', 'space {0}'.format(gen_string('alpha')),
            gen_string('alpha', 101),
            gen_string('html')
        )
        for invalid_name in invalid_names:
            with self.subTest(invalid_name):
                options = {
                    'auth-source-id': 1,
                    'login': invalid_name,
                    'mail': 'root@localhost',
                    'password': gen_string('alpha'),
                }
                self.logger.debug(str(options))
                with self.assertRaisesRegex(
                    CLIReturnCodeError,
                    u'Could not create the user:'
                ):
                    User.create(options)
示例#2
0
    def test_negative_create_with_invalid_username(self):
        """Create User with invalid Username

        :id: 8bb53001-6377-49fe-a85c-f92204a5dea4

        :expectedresults: User is not created. Appropriate error shown.

        :CaseImportance: Critical
        """
        invalid_names = (
            '', 'space {0}'.format(gen_string('alpha')),
            gen_string('alpha', 101),
            gen_string('html')
        )
        for invalid_name in invalid_names:
            with self.subTest(invalid_name):
                options = {
                    'auth-source-id': 1,
                    'login': invalid_name,
                    'mail': 'root@localhost',
                    'password': gen_string('alpha'),
                }
                self.logger.debug(str(options))
                with self.assertRaisesRegex(
                    CLIReturnCodeError,
                    u'Could not create the user:'
                ):
                    User.create(options)
示例#3
0
    def test_negative_create_with_invalid_username(self):
        """Create User with invalid Username

        @id: 8bb53001-6377-49fe-a85c-f92204a5dea4

        @Assert: User is not created. Appropriate error shown.
        """
        invalid_names = (
            '', 'space {0}'.format(gen_string('alpha')),
            gen_string('alpha', 101),
            gen_string('html')
        )
        for invalid_name in invalid_names:
            with self.subTest(invalid_name):
                options = {
                    'auth-source-id': 1,
                    'login': invalid_name,
                    'mail': 'root@localhost',
                    'password': gen_string('alpha'),
                }
                self.logger.debug(str(options))
                with self.assertRaises(CLIReturnCodeError) as raise_ctx:
                    User.create(options)
                self.assert_error_msg(
                    raise_ctx,
                    u'Could not create the user:'
                )
示例#4
0
    def test_negative_create_user_1(self):
        """@Test: Create User with invalid Username

        @Feature: User - Negative Create

        @Steps:
        1. Create User for all invalid Usernames in [2]
        using valid First Name, Surname, Email Address, Language, authorized by

        @Assert: User is not created. Appropriate error shown.
        """
        for invalid_name in ('',
                             'space {0}'.format(gen_string('alpha')),
                             gen_string('alpha', 101),
                             gen_string('html')):
            with self.subTest(invalid_name):
                options = {
                    'auth-source-id': 1,
                    'login': invalid_name,
                    'mail': 'root@localhost',
                    'password': gen_string('alpha'),
                }
                self.logger.debug(str(options))
                with self.assertRaises(CLIReturnCodeError):
                    UserObj.create(options)
示例#5
0
    def test_negative_create_with_blank_authorized_by(self):
        """Create User with blank Authorized by

        @Feature: User - Negative Create

        @Assert: User is not created. Appropriate error shown.
        """
        with self.assertRaises(CLIReturnCodeError):
            User.create({
                'auth-source-id': '',
                'login': gen_string('alpha'),
                'mail': 'root@localhost',
            })
示例#6
0
    def test_negative_create_with_blank_authorized_by(self):
        """Create User with blank Authorized by

        @Feature: User - Negative Create

        @Assert: User is not created. Appropriate error shown.
        """
        with self.assertRaises(CLIReturnCodeError):
            User.create({
                'auth-source-id': '',
                'login': gen_string('alpha'),
                'mail': 'root@localhost',
            })
示例#7
0
    def test_negative_create_with_blank_authorized_by(self):
        """Create User with blank Authorized by

        @id: 1f60fbf8-a5f0-432e-9b4e-60bc0224294a

        @Assert: User is not created. Appropriate error shown.
        """
        with self.assertRaises(CLIReturnCodeError):
            User.create({
                'auth-source-id': '',
                'login': gen_string('alpha'),
                'mail': 'root@localhost',
            })
示例#8
0
    def test_negative_create_with_blank_authorized_by(self):
        """Create User with blank Authorized by

        @id: 1f60fbf8-a5f0-432e-9b4e-60bc0224294a

        @Assert: User is not created. Appropriate error shown.
        """
        with self.assertRaises(CLIReturnCodeError) as raise_ctx:
            User.create({
                'auth-source-id': '',
                'login': gen_string('alpha'),
                'mail': 'root@localhost',
            })
        self.assert_error_msg(raise_ctx, u'Could not create the user:')
示例#9
0
    def test_negative_create_with_blank_authorized_by(self):
        """Create User with blank Authorized by

        :id: 1f60fbf8-a5f0-432e-9b4e-60bc0224294a

        :expectedresults: User is not created. Appropriate error shown.

        :CaseImportance: Critical
        """
        with self.assertRaisesRegex(CLIReturnCodeError,
                                    u'Could not create the user:'******'auth-source-id': '',
                'login': gen_string('alpha'),
                'mail': 'root@localhost',
            })
示例#10
0
    def test_negative_create_with_blank_authorized_by_full(self):
        """Create User with blank Authorized by but having matching
        values in Password and verify fields and using valid Username, First
        Name, Surname, Email Address, Language

        @id: 4b142a12-8354-437e-89cc-c0505bda2027

        @Assert: User is not created. Appropriate error shown.
        """
        with self.assertRaises(CLIReturnCodeError):
            User.create({
                'auth-source-id': '',
                'login': gen_string('alpha'),
                'mail': 'root@localhost',
                'password': gen_string('alpha'),
            })
示例#11
0
    def test_negative_create_with_blank_authorized_by_full(self):
        """Create User with blank Authorized by but having matching
        values in Password and verify fields and using valid Username, First
        Name, Surname, Email Address, Language

        @Feature: User - Negative Create Password and verify

        @Assert: User is not created. Appropriate error shown.
        """
        with self.assertRaises(CLIReturnCodeError):
            User.create({
                'auth-source-id': '',
                'login': gen_string('alpha'),
                'mail': 'root@localhost',
                'password': gen_string('alpha'),
            })
示例#12
0
    def test_negative_create_with_blank_authorized_by_full(self):
        """Create User with blank Authorized by but having matching
        values in Password and verify fields and using valid Username, First
        Name, Surname, Email Address, Language

        @id: 4b142a12-8354-437e-89cc-c0505bda2027

        @Assert: User is not created. Appropriate error shown.
        """
        with self.assertRaises(CLIReturnCodeError) as raise_ctx:
            User.create({
                'auth-source-id': '',
                'login': gen_string('alpha'),
                'mail': 'root@localhost',
                'password': gen_string('alpha'),
            })
        self.assert_error_msg(raise_ctx, u'Could not create the user:')
示例#13
0
    def test_negative_create_with_invalid_lastname(self):
        """Create User with invalid lastname

        @Feature: User - Negative Create

        @Assert: User is not created. Appropriate error shown.
        """
        for invalid_lastname in (gen_string("alpha", 51), gen_string("html")):
            with self.subTest(invalid_lastname):
                with self.assertRaises(CLIReturnCodeError):
                    User.create({
                        'auth-source-id': 1,
                        'login': gen_string('alpha'),
                        'lastname': invalid_lastname,
                        'mail': 'root@localhost',
                        'password': gen_string('alpha'),
                    })
示例#14
0
    def test_negative_create_user_5(self):
        """@Test: Create User with blank Authorized by

        @Feature: User - Negative Create

        @Steps:
        1. Create User with blank Authorized by
        using valid Username, First Name, Surname, Email Address, Language

        @Assert: User is not created. Appropriate error shown.
        """
        with self.assertRaises(CLIReturnCodeError):
            UserObj.create({
                'auth-source-id': '',
                'login': gen_string('alpha'),
                'mail': 'root@localhost',
            })
示例#15
0
    def test_negative_create_with_blank_authorized_by(self):
        """Create User with blank Authorized by

        :id: 1f60fbf8-a5f0-432e-9b4e-60bc0224294a

        :expectedresults: User is not created. Appropriate error shown.

        :CaseImportance: Critical
        """
        with self.assertRaisesRegex(
            CLIReturnCodeError,
            u'Could not create the user:'******'auth-source-id': '',
                'login': gen_string('alpha'),
                'mail': 'root@localhost',
            })
示例#16
0
    def test_negative_create_with_invalid_email(self):
        """Create User with invalid Email Address

        @Feature: User - Negative Create

        @Assert: User is not created. Appropriate error shown.
        """
        for email in invalid_emails_list():
            with self.subTest(email):
                with self.assertRaises(CLIReturnCodeError):
                    User.create({
                        'auth-source-id': 1,
                        'firstname': gen_string('alpha'),
                        'lastname': gen_string('alpha'),
                        'login': gen_string('alpha'),
                        'mail': email,
                        'password': gen_string('alpha'),
                    })
示例#17
0
    def test_negative_create_with_empty_email(self):
        """Create User with empty Email Address

        @id: e55b2937-9b43-45ee-aa22-2d4ae6da01f3

        @Assert: User is not created. Appropriate error shown.

        @BZ: 1204686
        """
        with self.assertRaises(CLIReturnCodeError):
            User.create({
                'auth-source-id': 1,
                'firstname': gen_string('alpha'),
                'lastname': gen_string('alpha'),
                'login': gen_string('alpha'),
                'mail': '',
                'password': gen_string('alpha'),
            })
示例#18
0
    def test_negative_create_with_invalid_lastname(self):
        """Create User with invalid lastname

        @id: f73d2374-6bdf-4d25-945e-46a34fe692e7

        @Assert: User is not created. Appropriate error shown.
        """
        for invalid_lastname in (gen_string("alpha", 51),
                                 gen_string("html")):
            with self.subTest(invalid_lastname):
                with self.assertRaises(CLIReturnCodeError):
                    User.create({
                        'auth-source-id': 1,
                        'login': gen_string('alpha'),
                        'lastname': invalid_lastname,
                        'mail': 'root@localhost',
                        'password': gen_string('alpha'),
                    })
示例#19
0
    def test_negative_create_with_invalid_firstname(self):
        """Create User with invalid First Name

        @id: 08b7be40-40f5-4423-91a6-03bb2bfb714c

        @Assert: User is not created. Appropriate error shown.
        """
        for invalid_firstname in (gen_string("alpha", 51),
                                  gen_string("html")):
            with self.subTest(invalid_firstname):
                with self.assertRaises(CLIReturnCodeError):
                    User.create({
                        'auth-source-id': 1,
                        'login': gen_string('alpha'),
                        'firstname': invalid_firstname,
                        'mail': 'root@localhost',
                        'password': gen_string('alpha'),
                    })
示例#20
0
    def test_negative_create_with_empty_email(self):
        """Create User with empty Email Address

        @Feature: User - Negative Create

        @Assert: User is not created. Appropriate error shown.

        @BZ: 1204686
        """
        with self.assertRaises(CLIReturnCodeError):
            User.create({
                'auth-source-id': 1,
                'firstname': gen_string('alpha'),
                'lastname': gen_string('alpha'),
                'login': gen_string('alpha'),
                'mail': '',
                'password': gen_string('alpha'),
            })
示例#21
0
    def test_negative_create_with_invalid_email(self):
        """Create User with invalid Email Address

        @id: e21be14c-e985-4f27-b189-1cfe454e03d2

        @Assert: User is not created. Appropriate error shown.
        """
        for email in invalid_emails_list():
            with self.subTest(email):
                with self.assertRaises(CLIReturnCodeError):
                    User.create({
                        'auth-source-id': 1,
                        'firstname': gen_string('alpha'),
                        'lastname': gen_string('alpha'),
                        'login': gen_string('alpha'),
                        'mail': email,
                        'password': gen_string('alpha'),
                    })
示例#22
0
    def test_negative_create_with_blank_authorized_by_full(self):
        """Create User with blank Authorized by but having matching
        values in Password and verify fields and using valid Username, First
        Name, Surname, Email Address, Language

        :id: 4b142a12-8354-437e-89cc-c0505bda2027

        :expectedresults: User is not created. Appropriate error shown.

        :CaseImportance: Critical
        """
        with self.assertRaisesRegex(CLIReturnCodeError,
                                    u'Could not create the user:'******'auth-source-id': '',
                'login': gen_string('alpha'),
                'mail': 'root@localhost',
                'password': gen_string('alpha'),
            })
示例#23
0
    def test_negative_create_with_invalid_username(self):
        """Create User with invalid Username

        @Feature: User - Negative Create

        @Assert: User is not created. Appropriate error shown.
        """
        for invalid_name in ('', 'space {0}'.format(gen_string('alpha')),
                             gen_string('alpha', 101), gen_string('html')):
            with self.subTest(invalid_name):
                options = {
                    'auth-source-id': 1,
                    'login': invalid_name,
                    'mail': 'root@localhost',
                    'password': gen_string('alpha'),
                }
                self.logger.debug(str(options))
                with self.assertRaises(CLIReturnCodeError):
                    User.create(options)
示例#24
0
    def test_negative_create_with_empty_email(self):
        """Create User with empty Email Address

        @id: e55b2937-9b43-45ee-aa22-2d4ae6da01f3

        @Assert: User is not created. Appropriate error shown.

        @BZ: 1204686
        """
        with self.assertRaises(CLIReturnCodeError) as raise_ctx:
            User.create({
                'auth-source-id': 1,
                'firstname': gen_string('alpha'),
                'lastname': gen_string('alpha'),
                'login': gen_string('alpha'),
                'mail': '',
                'password': gen_string('alpha'),
            })
        self.assert_error_msg(raise_ctx, u'Could not create the user:')
示例#25
0
    def test_negative_create_with_invalid_firstname(self):
        """Create User with invalid First Name

        @id: 08b7be40-40f5-4423-91a6-03bb2bfb714c

        @Assert: User is not created. Appropriate error shown.
        """
        invalid_first_names = (gen_string("alpha", 51), gen_string("html"))
        for invalid_first_name in invalid_first_names:
            with self.subTest(invalid_first_name):
                options = {
                    'auth-source-id': 1,
                    'login': gen_string('alpha'),
                    'firstname': invalid_first_name,
                    'mail': 'root@localhost',
                    'password': gen_string('alpha'),
                }
                with self.assertRaises(CLIReturnCodeError) as raise_ctx:
                    User.create(options)
                self.assert_error_msg(raise_ctx, u'Could not create the user')
示例#26
0
    def test_negative_create_with_invalid_lastname(self):
        """Create User with invalid lastname

        @id: f73d2374-6bdf-4d25-945e-46a34fe692e7

        @Assert: User is not created. Appropriate error shown.
        """
        invalid_lastnames = (gen_string("alpha", 51), gen_string("html"))
        for invalid_lastname in invalid_lastnames:
            with self.subTest(invalid_lastname):
                options = {
                    'auth-source-id': 1,
                    'login': gen_string('alpha'),
                    'lastname': invalid_lastname,
                    'mail': 'root@localhost',
                    'password': gen_string('alpha'),
                }
                with self.assertRaises(CLIReturnCodeError) as raise_ctx:
                    User.create(options)
                self.assert_error_msg(raise_ctx, u'Could not create the user')
示例#27
0
    def test_negative_create_with_invalid_email(self):
        """Create User with invalid Email Address

        @id: e21be14c-e985-4f27-b189-1cfe454e03d2

        @Assert: User is not created. Appropriate error shown.
        """
        for email in invalid_emails_list():
            with self.subTest(email):
                options = {
                    'auth-source-id': 1,
                    'firstname': gen_string('alpha'),
                    'lastname': gen_string('alpha'),
                    'login': gen_string('alpha'),
                    'mail': email,
                    'password': gen_string('alpha'),
                }
                with self.assertRaises(CLIReturnCodeError) as raise_ctx:
                    User.create(options)
                self.assert_error_msg(raise_ctx, u'Could not create the user')
示例#28
0
    def test_negative_create_user_3(self, opts):
        """@Test: Create User with invalid Surname

        @Feature: User - Negative Create

        @Steps:
        1. Create User for all invalid Surname in [2]
        using valid Username, First Name Email Address, Language, authorized by

        @Assert: User is not created. Appropriate error shown.

        """
        with self.assertRaises(CLIReturnCodeError):
            UserObj.create({
                'auth-source-id': 1,
                'login': gen_string('alpha'),
                'lastname': opts['lastname'],
                'mail': 'root@localhost',
                'password': gen_string('alpha'),
            })
示例#29
0
    def test_negative_create_with_invalid_username(self):
        """Create User with invalid Username

        @Feature: User - Negative Create

        @Assert: User is not created. Appropriate error shown.
        """
        for invalid_name in ('',
                             'space {0}'.format(gen_string('alpha')),
                             gen_string('alpha', 101),
                             gen_string('html')):
            with self.subTest(invalid_name):
                options = {
                    'auth-source-id': 1,
                    'login': invalid_name,
                    'mail': 'root@localhost',
                    'password': gen_string('alpha'),
                }
                self.logger.debug(str(options))
                with self.assertRaises(CLIReturnCodeError):
                    User.create(options)
示例#30
0
    def test_negative_create_with_empty_email(self):
        """Create User with empty Email Address

        :id: e55b2937-9b43-45ee-aa22-2d4ae6da01f3

        :expectedresults: User is not created. Appropriate error shown.

        :BZ: 1204686

        :CaseImportance: Critical
        """
        with self.assertRaisesRegex(CLIReturnCodeError,
                                    u'Could not create the user:'******'auth-source-id': 1,
                'firstname': gen_string('alpha'),
                'lastname': gen_string('alpha'),
                'login': gen_string('alpha'),
                'mail': '',
                'password': gen_string('alpha'),
            })
示例#31
0
    def test_negative_create_with_invalid_username(self):
        """Create User with invalid Username

        @id: 8bb53001-6377-49fe-a85c-f92204a5dea4

        @Assert: User is not created. Appropriate error shown.
        """
        invalid_names = ('', 'space {0}'.format(gen_string('alpha')),
                         gen_string('alpha', 101), gen_string('html'))
        for invalid_name in invalid_names:
            with self.subTest(invalid_name):
                options = {
                    'auth-source-id': 1,
                    'login': invalid_name,
                    'mail': 'root@localhost',
                    'password': gen_string('alpha'),
                }
                self.logger.debug(str(options))
                with self.assertRaises(CLIReturnCodeError) as raise_ctx:
                    User.create(options)
                self.assert_error_msg(raise_ctx, u'Could not create the user:')
示例#32
0
    def test_negative_create_with_invalid_email(self):
        """Create User with invalid Email Address

        :id: e21be14c-e985-4f27-b189-1cfe454e03d2

        :expectedresults: User is not created. Appropriate error shown.

        :CaseImportance: Critical
        """
        for email in invalid_emails_list():
            with self.subTest(email):
                options = {
                    'auth-source-id': 1,
                    'firstname': gen_string('alpha'),
                    'lastname': gen_string('alpha'),
                    'login': gen_string('alpha'),
                    'mail': email,
                    'password': gen_string('alpha'),
                }
                with self.assertRaisesRegex(CLIReturnCodeError,
                                            u'Could not create the user'):
                    User.create(options)
示例#33
0
    def test_negative_create_with_invalid_lastname(self):
        """Create User with invalid lastname

        :id: f73d2374-6bdf-4d25-945e-46a34fe692e7

        :expectedresults: User is not created. Appropriate error shown.

        :CaseImportance: Critical
        """
        invalid_lastnames = (gen_string("alpha", 51), gen_string("html"))
        for invalid_lastname in invalid_lastnames:
            with self.subTest(invalid_lastname):
                options = {
                    'auth-source-id': 1,
                    'login': gen_string('alpha'),
                    'lastname': invalid_lastname,
                    'mail': 'root@localhost',
                    'password': gen_string('alpha'),
                }
                with self.assertRaisesRegex(CLIReturnCodeError,
                                            u'Could not create the user'):
                    User.create(options)
示例#34
0
    def test_negative_create_with_invalid_firstname(self):
        """Create User with invalid First Name

        :id: 08b7be40-40f5-4423-91a6-03bb2bfb714c

        :expectedresults: User is not created. Appropriate error shown.

        :CaseImportance: Critical
        """
        invalid_first_names = (gen_string("alpha", 51), gen_string("html"))
        for invalid_first_name in invalid_first_names:
            with self.subTest(invalid_first_name):
                options = {
                    'auth-source-id': 1,
                    'login': gen_string('alpha'),
                    'firstname': invalid_first_name,
                    'mail': 'root@localhost',
                    'password': gen_string('alpha'),
                }
                with self.assertRaisesRegex(CLIReturnCodeError,
                                            u'Could not create the user'):
                    User.create(options)
示例#35
0
    def test_negative_create_user_2(self):
        """@Test: Create User with invalid Firstname

        @Feature: User - Negative Create

        @Steps:
        1. Create User for all invalid Firstname in [2]
        using valid Username, Surname, Email Address, Language, authorized by

        @Assert: User is not created. Appropriate error shown.
        """
        for invalid_firstname in (gen_string("alpha", 51),
                                  gen_string("html")):
            with self.subTest(invalid_firstname):
                with self.assertRaises(CLIReturnCodeError):
                    UserObj.create({
                        'auth-source-id': 1,
                        'login': gen_string('alpha'),
                        'firstname': invalid_firstname,
                        'mail': 'root@localhost',
                        'password': gen_string('alpha'),
                    })
示例#36
0
    def test_bugzilla_1204686(self):
        """@Test: Create User with Empty Email Address

        @Feature: User - Negative Create

        @Steps:
        1. Create User with empty Email Address in [2]
        using valid Username, First Name, Surname, Language, authorized by

        @Assert: User is not created. Appropriate error shown.

        @BZ: 1204686
        """
        with self.assertRaises(CLIReturnCodeError):
            UserObj.create({
                'auth-source-id': 1,
                'firstname': gen_string('alpha'),
                'lastname': gen_string('alpha'),
                'login': gen_string('alpha'),
                'mail': '',
                'password': gen_string('alpha'),
            })
示例#37
0
    def test_negative_create_user_4(self):
        """@Test: Create User with invalid Email Address

        @Feature: User - Negative Create

        @Steps:
        1. Create User for all invalid Email Address in [2]
        using valid Username, First Name, Surname, Language, authorized by

        @Assert: User is not created. Appropriate error shown.
        """
        for email in invalid_emails_list():
            with self.subTest(email):
                with self.assertRaises(CLIReturnCodeError):
                    UserObj.create({
                        'auth-source-id': 1,
                        'firstname': gen_string('alpha'),
                        'lastname': gen_string('alpha'),
                        'login': gen_string('alpha'),
                        'mail': email,
                        'password': gen_string('alpha'),
                    })
示例#38
0
    def test_negative_create_with_invalid_firstname(self):
        """Create User with invalid First Name

        @id: 08b7be40-40f5-4423-91a6-03bb2bfb714c

        @Assert: User is not created. Appropriate error shown.
        """
        invalid_first_names = (gen_string("alpha", 51), gen_string("html"))
        for invalid_first_name in invalid_first_names:
            with self.subTest(invalid_first_name):
                options = {
                    'auth-source-id': 1,
                    'login': gen_string('alpha'),
                    'firstname': invalid_first_name,
                    'mail': 'root@localhost',
                    'password': gen_string('alpha'),
                }
                with self.assertRaises(CLIReturnCodeError) as raise_ctx:
                    User.create(options)
                self.assert_error_msg(
                    raise_ctx,
                    u'Could not create the user'
                )
示例#39
0
    def test_negative_create_with_invalid_lastname(self):
        """Create User with invalid lastname

        @id: f73d2374-6bdf-4d25-945e-46a34fe692e7

        @Assert: User is not created. Appropriate error shown.
        """
        invalid_lastnames = (gen_string("alpha", 51), gen_string("html"))
        for invalid_lastname in invalid_lastnames:
            with self.subTest(invalid_lastname):
                options = {
                    'auth-source-id': 1,
                    'login': gen_string('alpha'),
                    'lastname': invalid_lastname,
                    'mail': 'root@localhost',
                    'password': gen_string('alpha'),
                }
                with self.assertRaises(CLIReturnCodeError) as raise_ctx:
                    User.create(options)
                self.assert_error_msg(
                    raise_ctx,
                    u'Could not create the user'
                )
示例#40
0
    def test_negative_create_with_empty_email(self):
        """Create User with empty Email Address

        :id: e55b2937-9b43-45ee-aa22-2d4ae6da01f3

        :expectedresults: User is not created. Appropriate error shown.

        :BZ: 1204686

        :CaseImportance: Critical
        """
        with self.assertRaisesRegex(
            CLIReturnCodeError,
            u'Could not create the user:'******'auth-source-id': 1,
                'firstname': gen_string('alpha'),
                'lastname': gen_string('alpha'),
                'login': gen_string('alpha'),
                'mail': '',
                'password': gen_string('alpha'),
            })
示例#41
0
    def test_negative_create_with_invalid_email(self):
        """Create User with invalid Email Address

        :id: e21be14c-e985-4f27-b189-1cfe454e03d2

        :expectedresults: User is not created. Appropriate error shown.

        :CaseImportance: Critical
        """
        for email in invalid_emails_list():
            with self.subTest(email):
                options = {
                    'auth-source-id': 1,
                    'firstname': gen_string('alpha'),
                    'lastname': gen_string('alpha'),
                    'login': gen_string('alpha'),
                    'mail': email,
                    'password': gen_string('alpha'),
                }
                with self.assertRaisesRegex(
                    CLIReturnCodeError,
                    u'Could not create the user'
                ):
                    User.create(options)
示例#42
0
    def test_negative_create_with_invalid_lastname(self):
        """Create User with invalid lastname

        :id: f73d2374-6bdf-4d25-945e-46a34fe692e7

        :expectedresults: User is not created. Appropriate error shown.

        :CaseImportance: Critical
        """
        invalid_lastnames = (gen_string("alpha", 51), gen_string("html"))
        for invalid_lastname in invalid_lastnames:
            with self.subTest(invalid_lastname):
                options = {
                    'auth-source-id': 1,
                    'login': gen_string('alpha'),
                    'lastname': invalid_lastname,
                    'mail': 'root@localhost',
                    'password': gen_string('alpha'),
                }
                with self.assertRaisesRegex(
                    CLIReturnCodeError,
                    u'Could not create the user'
                ):
                    User.create(options)
示例#43
0
    def test_negative_create_with_invalid_firstname(self):
        """Create User with invalid First Name

        :id: 08b7be40-40f5-4423-91a6-03bb2bfb714c

        :expectedresults: User is not created. Appropriate error shown.

        :CaseImportance: Critical
        """
        invalid_first_names = (gen_string("alpha", 51), gen_string("html"))
        for invalid_first_name in invalid_first_names:
            with self.subTest(invalid_first_name):
                options = {
                    'auth-source-id': 1,
                    'login': gen_string('alpha'),
                    'firstname': invalid_first_name,
                    'mail': 'root@localhost',
                    'password': gen_string('alpha'),
                }
                with self.assertRaisesRegex(
                    CLIReturnCodeError,
                    u'Could not create the user'
                ):
                    User.create(options)