Exemple #1
0
    def setUp(self):
        super(EmployeeResourceTestCase, self).setUp()

        # Define new account test and create it.
        register_user(self)

        # Define variable to use requests properly
        self.client = TestApiClient()

        # Create and save new department for testing
        self.department_1 = Department.objects.create(name='department_1')

        # Create and save new employee for testing
        self.employee_1 = Employee.objects.create(first_name='John', last_name='Cena', birthday='1964-01-05', email='*****@*****.**', status=1, department=self.department_1)

        # Define api url for get and post method
        self.api_url = '/api/v1/employee/'
        self.api_url_custom = '/api/v1/custom_employee/'

        # Define data for POST method
        self.post_data = {
            'first_name': 'Cori',
            'last_name': 'Lanyon',
            'birthday': '6/28/1909',
            'email': '*****@*****.**',
            'status': 1,
            'department': '/api/v1/department/{0}/'.format(self.department_1.pk)
        }
Exemple #2
0
    def setUp(self):
        super(ContactResourceTestCase, self).setUp()

        # Define new account test and create it.
        register_user(self)

        # Define variable to use requests properly
        self.client = TestApiClient()

        # Create and save new department for testing
        self.department_1 = Department.objects.create(name='department_1')

        # Create and save new employee for testing
        self.employee_1 = Employee.objects.create(first_name='John',
                                                  last_name='Cena',
                                                  birthday='1964-01-05',
                                                  email='*****@*****.**',
                                                  status=1,
                                                  department=self.department_1)

        # Create and save new contact for testing
        self.contact_1 = Contact.objects.create(name='contact_1',
                                                employee=self.employee_1)

        # Define api url for get and post method
        self.api_url = '/api/v1/contact/'

        # Define data for POST method
        self.post_data = {
            'name': 'test contact',
            'employee': '/api/v1/employee/{0}/'.format(self.employee_1.pk)
        }
    def setUpClass(cls):
        cls.client = BaseUser(JohnDoe)
        cls.page = None
        cls.config = Config()

        with allure.step("Initial data setup > clean DB"):
            clean_database(cls.config)

        register_user(user=cls.client, config=cls.config)
    def setUp(self):

        with allure.step("Initial data setup > clean DB"):
            clean_database(self.config)

        with allure.step("Initial data setup > register test user"):
            register_user(user=self.client, config=self.config)

        with allure.step("Initial data setup: {}".format(
                self.config.base_url + ForgotLoginInfoPageContent.URL)):
            with allure.step("Open web browser"):
                self.page = open_web_browser(config=self.config,
                                             page_model=self.page_model,
                                             page_content=self.page_context)
    def setUpClass(cls):
        cls.user = BaseUser(JohnDoe)
        cls.page_model = HomePageModel
        cls.page_content = HomePageContent
        cls.config = Config()

        with allure.step("Initial data setup > clean DB"):
            clean_database(cls.config)

        with allure.step("Initial data setup > register test user"):
            register_user(cls.user, cls.config)

        with allure.step("Open web browser"):
            cls.page = open_web_browser(config=cls.config,
                                        page_model=cls.page_model,
                                        page_content=cls.page_content)
Exemple #6
0
    def setUp(self):
        super(DepartmentResourceTest, self).setUp()

        # Define new account test and create it.
        register_user(self)

        # Define variable to use requests properly
        self.client = TestApiClient()

        # Create and save a new department
        self.department_1 = DepartmentFactory.create()

        # Define api url for get and post method
        self.api_url = '/api/v1/department/'

        # Define data for POST method
        self.post_data = {'name': 'test department'}
Exemple #7
0
    def setUpClass(cls):
        cls.user = BaseUser(JaneDoe)
        cls.payee = JohnDoe
        cls.page_model = HomePageModel
        cls.page_context = HomePageContent
        cls.transfer_amount = '153.45'
        cls.account = '11223344'
        cls.total_left = cls.user.balance - float(cls.transfer_amount)
        cls.config = Config()

        with allure.step("Initial data setup > clean DB"):
            clean_database(config=cls.config)

        with allure.step("Initial data setup > register test user"):
            register_user(user=cls.user, config=cls.config)

        with allure.step("Open web browser"):
            cls.page = open_web_browser(config=cls.config,
                                        page_model=cls.page_model,
                                        page_content=cls.page_context)