class TestCreateUser():
    @classmethod
    def setup_class(self):
        self.api_utils = RestUtils()
        self.api_utils.reset_mock()

    def test_create_message_with_all_parameters(self):

        body = create_forum_body(theme='Automation',
                                 subject='First test',
                                 message='Automating my first test')
        print body
        response = self.api_utils.create_message_forum(body=body)
        assert_true(response.ok)
        assert_equals(response.content, 'message created')

    def test_create_message_with_incorrect_theme(self):

        theme_list = ['QA', 'security', '', 'AUTOMATION', '"testing"']

        for theme in theme_list:

            body = create_forum_body(theme=theme,
                                     subject='First test',
                                     message='Automating my first test')
            response = self.api_utils.create_message_forum(body=body)
            assert_equals(response.status_code, 400)

            try:
                response_body = response.json()
            except ValueError:
                assert False, "JSON Cannot be decode. Response format not correspond with JSON format"

            assert_equals(response_body['message'], 'Theme not valid')
class TestCreateUser():

    @classmethod
    def setup_class(self):
        self.api_utils = RestUtils()
        self.api_utils.reset_mock()

    def test_create_message_with_all_parameters(self):

        body = create_forum_body(theme='Automation', subject='First test', message='Automating my first test')
        print body
        response = self.api_utils.create_message_forum(body=body)
        assert_true(response.ok)
        assert_equals(response.content, 'message created')

    def test_create_message_with_incorrect_theme(self):

        theme_list = ['QA', 'security', '', 'AUTOMATION', '"testing"']

        for theme in theme_list:

            body = create_forum_body(theme=theme, subject='First test', message='Automating my first test')
            response = self.api_utils.create_message_forum(body=body)
            assert_equals(response.status_code, 400)

            try:
                response_body = response.json()
            except ValueError:
                assert False, "JSON Cannot be decode. Response format not correspond with JSON format"

            assert_equals(response_body['message'], 'Theme not valid')
Example #3
0
class TestCreateUser():
    @classmethod
    def setup_class(self):

        self.api_utils = RestUtils()
        self.api_utils.reset_mock()

    def test_create_user_with_all_parameters(self):
        pass

    def test_not_existent_role(self):
        pass

    def test_existent_user(self):
        pass
Example #4
0
class TestCreateUser():

    @classmethod
    def setup_class(self):

        self.api_utils = RestUtils()
        self.api_utils.reset_mock()

    def test_create_user_with_all_parameters(self):
        pass

    def test_not_existent_role(self):
        pass

    def test_existent_user(self):
        pass