当前位置: 首页>>代码示例>>Python>>正文


Python AccountingMethods.save_user_password方法代码示例

本文整理汇总了Python中tests.worker_accounting.class_accounting.AccountingMethods.save_user_password方法的典型用法代码示例。如果您正苦于以下问题:Python AccountingMethods.save_user_password方法的具体用法?Python AccountingMethods.save_user_password怎么用?Python AccountingMethods.save_user_password使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在tests.worker_accounting.class_accounting.AccountingMethods的用法示例。


在下文中一共展示了AccountingMethods.save_user_password方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_restorePassword_by_phone_incorrect_user_wait_for_registration

# 需要导入模块: from tests.worker_accounting.class_accounting import AccountingMethods [as 别名]
# 或者: from tests.worker_accounting.class_accounting.AccountingMethods import save_user_password [as 别名]
    def test_restorePassword_by_phone_incorrect_user_wait_for_registration(self, status='WAIT_FOR_REGISTRATION'):
        """
        Title: Я не могу восстановить пароль по номеру телефона, если мой пользователь не окончил регистрацию
        в прошлый раз (WAIT_FOR_REGISTRATION)
        Description:
        * Отображается сообщение "Вы не закончили регистрацию"
        """
        service_log.run(self)
        self.go_authorization_page(self.driver)
        self.go_restore_page(self.driver)
        self.click_to_phone(self.driver)
        phone, sent_passwd_button = self.get_data_restore(self.driver)
        user = databases.db1.accounting.get_not_enabled_user(status)[0]
        AccountingMethods.save_user_password(user_id=user["id"], hash_passwd=user["code_value"], salt=user["salt"])

        phone.send_keys(user["phone"][1:])
        self.click_button(sent_passwd_button, sleep=0.5)

        user_new_info = databases.db1.accounting.get_data_accounts_by_user_id_and_status(user["id"], status)[0]

        msg_error1 = "ОШИБКА: Хеши паролей не совпадают. Пароль изменился"
        self.assertEqual(user["code_value"], user_new_info["code_value"], msg_error1)

        # сравниваем хеш нового и старого пароля
        msg_error2 = "ОШИБКА: Соль паролей не совпадает. Пароль изменился"
        self.assertEqual(user["salt"], user_new_info["salt"], msg_error2)

        self.check_message_error_by_status_user(self.driver, status)
开发者ID:Maksim1988,项目名称:test,代码行数:30,代码来源:test_restore.py

示例2: test_authorization_by_phone_incorrect_user_disabled

# 需要导入模块: from tests.worker_accounting.class_accounting import AccountingMethods [as 别名]
# 或者: from tests.worker_accounting.class_accounting.AccountingMethods import save_user_password [as 别名]
    def test_authorization_by_phone_incorrect_user_disabled(self, type_password="CORRECT"):
        """
        Title: Я не могу войти в систему по телефону, если  мой пользователь в статусе DISABLED
        (пользователь Заблокирован)
        Description:
        * Отображается соответствующее сообщение
        """
        service_log.run(self)
        status = "DISABLED"
        user = databases.db1.accounting.get_not_enabled_user(status=status)[0]
        AccountingMethods.save_user_password(user_id=user["id"], hash_passwd=user["code_value"])

        # Устанавливаем новый пароль для пользователя
        default_new_passwd = AccountingMethods.get_default_password()
        hash_res_new = generate_sha256(default_new_passwd, user["salt"])
        databases.db1.accounting.update_user_password(user["id"], hash_res_new)

        # Переходим на страницу авторизации
        self.go_authorization_page(self.driver)
        obj_phone, obj_password, obj_submit_button = self.get_data_authorization(self.driver)
        changed_passwd = self.get_password(type_passwd=type_password, source_passwd=default_new_passwd)
        changed_phone = self.get_phone(type_phone=self.type_phone, source_phone=user["phone"])

        # Вводим данные на авторизацию
        self.send_password(password_object=obj_password, password_number=changed_passwd)
        self.send_phone(phone_object=obj_phone, phone_number=changed_phone)

        # Нажатие на кнопку авторизации
        self.submit_button(obj_submit_button)

        # Проверка блокировки пользователя
        Navigate.get_element_navigate(self.driver, self.check_auth.ERR_CHECK_DISABLED)
        Navigate.go_to_main_page(self.driver)
        self.check_header_widget_visitor(self.driver)
开发者ID:Maksim1988,项目名称:test,代码行数:36,代码来源:test_authorization.py

示例3: test_restorePassword_by_phone_incorrect_password

# 需要导入模块: from tests.worker_accounting.class_accounting import AccountingMethods [as 别名]
# 或者: from tests.worker_accounting.class_accounting.AccountingMethods import save_user_password [as 别名]
    def test_restorePassword_by_phone_incorrect_password(self):
        """
        Title: Я не могу войти в систему, если некорректно введу полученный при восстановлении по телефону пароль.
        Description:
            * Отобразится сообщение "Пароль неверен"
        """
        service_log.run(self)
        password = ['incorrect pass', '123']
        self.go_authorization_page(self.driver)
        self.go_restore_page(self.driver)
        self.click_to_phone(self.driver)

        phone, sent_passwd_button = self.get_data_restore(self.driver)
        user = databases.db1.accounting.get_users_with_status()[0]
        AccountingMethods.save_user_password(user_id=user["id"], hash_passwd=user["code_value"], salt=user["salt"])
        default_new_passwd = AccountingMethods.get_default_password(4)
        override_passwd_hash = generate_sha256(default_new_passwd, user["salt"])
        databases.db1.accounting.update_passwd_hash_by_phone(passwd_hash=override_passwd_hash, phone=user["phone"])

        # вводим номер телефона
        phone.send_keys(user["phone"][1:])
        self.click_button(sent_passwd_button)
        self.check_password_is_sent(self.driver)

        pass_input = self.get_pass_input(self.driver)
        submit_button = self.get_login(self.driver)

        self.check_form_sent_passwd(self.get_form_note(self.driver))

        pass_input.send_keys(password[1])
        self.click_button(submit_button)

        time.sleep(1)
        self.check_incorrect_passwd_or_phone(self.driver)
开发者ID:Maksim1988,项目名称:test,代码行数:36,代码来源:test_restore.py

示例4: setUp

# 需要导入模块: from tests.worker_accounting.class_accounting import AccountingMethods [as 别名]
# 或者: from tests.worker_accounting.class_accounting.AccountingMethods import save_user_password [as 别名]
    def setUp(cls):
        # Подготовка работы с selenium
        cls.driver = HelpLifeCycleCheckMethods.get_driver()
        service_log.preparing_env(cls)
        # Настройка окружения и вспомогательные параметры
        cls.default_user_id = AccountingMethods.get_default_user_id(role="buyer")
        databases.db1.accounting.update_account_details_by_criteria(cls.default_user_id, "locale='ru'")
        cls.user = databases.db1.accounting.get_user_by_account_id(cls.default_user_id)[0]
        AccountingMethods.save_user_password(user_id=cls.user["id"], hash_passwd=cls.user["code_value"])

        # Устанавливаем новый пароль для пользователя
        cls.default_new_passwd = AccountingMethods.get_default_password()
        hash_res_new = generate_sha256(cls.default_new_passwd, cls.user["salt"])
        databases.db1.accounting.update_user_password(cls.user["id"], hash_res_new)

        cls.go_main(cls.driver, phone=cls.user["phone"], passwd=cls.default_new_passwd, flag_auth=True)
        # Переход в Контакты
        # cls.get_page(cls.driver, cls.path_user_contact.URL_FAVORITES_USERS)
        # Переход по кнопке Новый контакт
        # cls.get_element_navigate(cls.driver, cls.click_user_contact.BTN_NEW_CONTACT).click()
        # cls.input_phone = cls.get_element_navigate(cls.driver, cls.input_user_contact.PHONE)
        # Получить список пользователей в контактах у пользователя
        cls.fav_users_list = databases.db1.accounting.get_fav_user_by_user_id(cls.user["id"])
        l = lambda l: list() if cls.fav_users_list is None else cls.fav_users_list
        cls.fav_list = [str(value["favorites_account_id"]) for value in l(cls.fav_users_list)]
        # чтобы исключить попадание себя в список контактов
        cls.fav_list.append(str(cls.user["id"]))
开发者ID:Maksim1988,项目名称:test,代码行数:29,代码来源:test_user_contacts.py

示例5: test_authorization_by_email_incorrect_user_disabled

# 需要导入模块: from tests.worker_accounting.class_accounting import AccountingMethods [as 别名]
# 或者: from tests.worker_accounting.class_accounting.AccountingMethods import save_user_password [as 别名]
    def test_authorization_by_email_incorrect_user_disabled(self):
        """
        Title: Я не могу войти в систему по e-mail, если мой пользователь в статусе DISABLED (пользователь Заблокирован)
        Description:
        * Отображается соответствующее сообщение
        """
        service_log.run(self)
        criteria = "display_name is not NULL"
        stamp = str(time.time())
        email = "oratest+%[email protected]" % stamp
        user = databases.db1.accounting.get_user_by_criteria(account_status="DISABLED", criteria=criteria)[0]
        databases.db1.accounting.update_account_details_by_criteria(user["id"], "email='%s'" % email)
        AccountingMethods.save_user_password(user_id=user["id"], hash_passwd=user["code_value"])

        # Устанавливаем новый пароль для пользователя
        default_new_passwd = AccountingMethods.get_default_password()
        hash_res_new = generate_sha256(self.default_new_passwd, user["salt"])
        databases.db1.accounting.update_user_password(user["id"], hash_res_new)
        self.click_reg_and_auth(self.driver)
        self.click_tab_login(self.driver)
        auth_form = self.get_auth_email_form(self.driver)
        auth_form["email_input"].send_keys(email)
        auth_form["password_input"].send_keys(default_new_passwd)
        self.click_button(auth_form["login_btn"])
        self.get_element_navigate(self.driver, self.check_auth.ERR_CHECK_DISABLED)
        self.go_to_main_page(self.driver)
        self.check_header_widget_visitor(self.driver)
开发者ID:Maksim1988,项目名称:test,代码行数:29,代码来源:test_authorization.py

示例6: test_restore_by_email_incorrect_user_disabled

# 需要导入模块: from tests.worker_accounting.class_accounting import AccountingMethods [as 别名]
# 或者: from tests.worker_accounting.class_accounting.AccountingMethods import save_user_password [as 别名]
    def test_restore_by_email_incorrect_user_disabled(self, status='DISABLED'):
        """
        Title: Я не могу восстановить пароль по e-mail, если мой пользователь заблокирован (Disabled)
        """
        service_log.run(self)
        self.go_authorization_page(self.driver)
        self.go_restore_page(self.driver)
        restore_form = self.get_restore_email_form(self.driver)
        user = databases.db1.accounting.get_not_enabled_user(status)[0]
        email = self.get_new_email(databases.db1)
        databases.db1.accounting.update_account_details_by_criteria(user["id"], "email='%s'" % email.lower())
        AccountingMethods.save_user_password(user_id=user["id"], hash_passwd=user["code_value"], salt=user["salt"])

        self.input_str(restore_form['email_input'], email)
        self.element_click(self.driver, restore_form['restore_btn'], change_page_url=False)

        user_new_info = databases.db1.accounting.get_data_accounts_by_user_id_and_status(user["id"], status)[0]

        msg_error1 = "ОШИБКА: Хеши паролей не совпадают. Пароль изменился"
        self.assertEqual(user["code_value"], user_new_info["code_value"], msg_error1)

        # сравниваем хеш нового и старого пароля
        msg_error2 = "ОШИБКА: Соль паролей не совпадает. Пароль изменился"
        self.assertEqual(user["salt"], user_new_info["salt"], msg_error2)

        self.check_message_error_by_status_user(self.driver, status)
开发者ID:Maksim1988,项目名称:test,代码行数:28,代码来源:test_restore_email.py

示例7: test_authorization_by_phone_incorrect_user_wait_for_registration

# 需要导入模块: from tests.worker_accounting.class_accounting import AccountingMethods [as 别名]
# 或者: from tests.worker_accounting.class_accounting.AccountingMethods import save_user_password [as 别名]
    def test_authorization_by_phone_incorrect_user_wait_for_registration(self, type_password="CORRECT"):
        """
        Title: Я не могу войти в систему по телефону, если мой пользователь в статусе WAIT_FOR_REGISTRATION
        (пользователь не закончил регистрацию)
        Description:
        * Отображается соответствующее сообщение
        """
        service_log.run(self)
        status = "WAIT_FOR_REGISTRATION"
        user = databases.db1.accounting.get_not_enabled_user(status=status)[0]
        AccountingMethods.save_user_password(user_id=user["id"], hash_passwd=user["code_value"])

        # Устанавливаем новый пароль для пользователя
        default_new_passwd = AccountingMethods.get_default_password()
        hash_res_new = generate_sha256(default_new_passwd, user["salt"])
        databases.db1.accounting.update_user_password(user["id"], hash_res_new)

        # Переходим на страницу авторизации
        self.go_authorization_page(self.driver)
        obj_phone, obj_password, obj_submit_button = self.get_data_authorization(self.driver)
        changed_passwd = self.get_password(type_passwd=type_password, source_passwd=default_new_passwd)
        changed_phone = self.get_phone(type_phone=self.type_phone, source_phone=user["phone"])

        # Вводим данные на авторизацию
        self.send_password(password_object=obj_password, password_number=changed_passwd)
        self.send_phone(phone_object=obj_phone, phone_number=changed_phone)

        # Нажатие на кнопку авторизации
        self.submit_button(obj_submit_button)

        # Проверка пользователя с незаконченной регистрацией
        self.check_user_wait_for_registration(self.driver)
开发者ID:Maksim1988,项目名称:test,代码行数:34,代码来源:test_authorization.py

示例8: setUp

# 需要导入模块: from tests.worker_accounting.class_accounting import AccountingMethods [as 别名]
# 或者: from tests.worker_accounting.class_accounting.AccountingMethods import save_user_password [as 别名]
    def setUp(cls):
        # Настройка окружения и вспомогательные параметры
        default_user_id = AccountingMethods.get_default_user_id(role='seller')
        cls.user = databases.db1.accounting.get_user_by_account_id(default_user_id)[0]
        cls.payment_db = databases.db1.accounting.get_payment_details_by_user_id(default_user_id)
        databases.db1.accounting.update_account_details_by_criteria(default_user_id, "locale='ru'")
        AccountingMethods.save_user_password(user_id=cls.user["id"], hash_passwd=cls.user["code_value"],
                                             salt=cls.user["salt"])
        # Подготовка работы с selenium
        cls.driver = HelpLifeCycleCheckMethods.get_driver()
        service_log.preparing_env(cls)
        # Устанавливаем новый пароль для пользователя
        default_new_passwd = AccountingMethods.get_default_password()
        hash_res_new = generate_sha256(default_new_passwd, cls.user["salt"])
        databases.db1.accounting.update_user_password(cls.user["id"], hash_res_new)
        cls.go_to_main_page(cls.driver)
        cls.go_main(cls.driver, phone=cls.user["phone"], passwd=default_new_passwd, flag_api=False)

        # Переход на страницу Оплата и выключение всех настроек оплаты
        cls.get_page(cls.driver, cls.path_settings.URL_PAYMENT_INFO)
        payment_info = cls.get_status_payment_options(cls.payment_db)
        payments = cls.get_payment_form(cls.driver, payment_info)
        cls.change_all_payment_options(cls.driver, payment_info, drop=True)
        cls.click_button(payments["save_btn"])
        cls.element_is_present(cls.driver, cls.check_settings.CHANGE_PAYMENTS_SUCCESS)
开发者ID:Maksim1988,项目名称:test,代码行数:27,代码来源:test_store_payments.py

示例9: test_as_buyer_to_inactive_good

# 需要导入模块: from tests.worker_accounting.class_accounting import AccountingMethods [as 别名]
# 或者: from tests.worker_accounting.class_accounting.AccountingMethods import save_user_password [as 别名]
    def test_as_buyer_to_inactive_good(self):
        """
        Title: Я, как Покупатель, не могу написать продавцу сообщение по Не активному товару, т.к. "Связаться с продавцом" залочена
        """
        databases.db1.accounting.update_account_details_by_criteria(self.default_user_id, "locale='ru'")
        self.user = databases.db1.accounting.get_user_by_account_id(self.default_user_id)[0]
        self.shop = databases.db1.accounting.get_shop_details_by_shop_id(self.user["shop_id"])[0]

        AccountingMethods.save_user_password(user_id=self.user["id"], hash_passwd=self.user["code_value"])

        # Устанавливаем новый пароль для пользователя
        self.default_new_passwd = AccountingMethods.get_default_password()
        hash_res_new = generate_sha256(self.default_new_passwd, self.user["salt"])
        databases.db1.accounting.update_user_password(self.user["id"], hash_res_new)

        self.go_main(self.driver, phone=self.user["phone"], passwd=self.default_new_passwd, flag_auth=True)

        self.get_page(self.driver, self.path_shop.URL_SHOP % self.default_seller_id)
        list_good_id = self.get_good_id_from_page_source(self.driver, self.path_shop.TO_FIND_GOODS)
        self.good_id = list_good_id[0]
        ware_cassandra = databases.db7.warehouse.get_wares_by_ware_id(self.good_id)[0]
        self.update_data_content(ware_cassandra, self.deserialize_content(ware_cassandra['content']))
        # Меняем статус на BANNED
        services.warehouse.root.tframed.makeModeration(self.good_id, False, self.moderator_id)

        self.get_page(self.driver, self.path_good.URL_GOOD % self.good_id)
        self.data_good, good_str = self.get_good_data(self.driver)
        self.get_element_navigate(self.driver, self.click_good.BTN_CALL_SELLER_HOLD)
开发者ID:Maksim1988,项目名称:test,代码行数:30,代码来源:test_chat.py

示例10: test_restorePassword_by_phone_resend_password

# 需要导入模块: from tests.worker_accounting.class_accounting import AccountingMethods [as 别名]
# 或者: from tests.worker_accounting.class_accounting.AccountingMethods import save_user_password [as 别名]
    def test_restorePassword_by_phone_resend_password(self):
        """
        Title: Я могу запросить Повторную отправку пароля, при восстановлении пароля по телефону
        Description:
            * Отображается соответствующее сообщение
        """
        service_log.run(self)
        self.go_authorization_page(self.driver)
        self.go_restore_page(self.driver)
        self.click_to_phone(self.driver)
        phone, sent_passwd_button = self.get_data_restore(self.driver)
        user = databases.db1.accounting.get_for_restore()[0]
        AccountingMethods.save_user_password(user_id=user["id"], hash_passwd=user["code_value"], salt=user["salt"])

        phone.send_keys(user["phone"][1:])
        self.click_button(sent_passwd_button)
        self.check_password_is_sent(self.driver)
        self.check_form_sent_passwd(self.get_form_note(self.driver))
        data1 = databases.db1.accounting.get_sms(phone=user["phone"])[0]
        self.check_sms_status(data1)


        not_get_passwd = self.get_message_have_not_receiver_passwd(self.driver)
        self.click_button(not_get_passwd)
        self.check_instruction_not_receiver_passwd(self.driver)
        self.click_button(self.get_repeat_send_passwd(self.driver))

        data2 = databases.db1.accounting.get_sms(phone=user["phone"])[0]
        self.check_sms_status(data2)
        new_passwd1 = data1["message"][-5:]
        new_passwd2 = data2["message"][-5:]
        msg_error = "ОШИБКА: Первый высланный пароль совпадает с повторно высланным паролем"
        self.assertNotEqual(new_passwd1, new_passwd2, msg_error)
开发者ID:Maksim1988,项目名称:test,代码行数:35,代码来源:test_restore.py

示例11: test_registration_by_phone_incorrect_password

# 需要导入模块: from tests.worker_accounting.class_accounting import AccountingMethods [as 别名]
# 或者: from tests.worker_accounting.class_accounting.AccountingMethods import save_user_password [as 别名]
    def test_registration_by_phone_incorrect_password(self):
        """
        Title: Я не могу зарегистрироваться, если некорректно введу полученный пароль.
        Отобразится сообщение "Пароль неверен"
        """
        service_log.run(self)
        user_name = 'Vasya vvedet parol 6 simvolov'
        login = str(random.randrange(1000000000, 7007777777, 1))
        self.get_page(self.driver, self.path_reg.URL_REG)
        self.click_to_phone(self.driver)
        obj_phone, obj_username, obj_submit_button = self.get_data_registration(self.driver)

        # Вводим имя пользователя, пароль
        obj_username.send_keys(user_name)
        obj_phone.send_keys(login)
        self.click_button(obj_submit_button)

        info_user = databases.db1.accounting.get_data_user_by_phone('7' + login)[0]  # salt
        password_field = self.get_name_pass(self.driver)  # password
        AccountingMethods.save_user_password(info_user["id"], info_user["code_value"], info_user["salt"])

        # генерируем новый пароль и подменяем на него
        password = AccountingMethods.get_default_password(5)
        hash_res_new = generate_sha256(password, info_user["salt"])
        databases.db1.accounting.update_user_password(info_user["id"], hash_res_new)
        databases.db1.accounting.update_user_salt(info_user["id"], info_user["salt"])

        # вставляем пароль и пробуем зарегистрироваться
        password_field.send_keys(password)
        ok_button = self.get_submit_ok(self.driver)
        self.click_button(ok_button)
        self.check_not_right_password(self.driver)
开发者ID:Maksim1988,项目名称:test,代码行数:34,代码来源:test_phone_registration.py

示例12: test_restorePassword_by_phone_form_empty_password

# 需要导入模块: from tests.worker_accounting.class_accounting import AccountingMethods [as 别名]
# 或者: from tests.worker_accounting.class_accounting.AccountingMethods import save_user_password [as 别名]
    def test_restorePassword_by_phone_form_empty_password(self):
        """
        Title: Если не введен пришедший по смс пароль. Отображается сообщение "Введите пароль"
        """
        service_log.run(self)
        password = ['empty pass', '']
        self.go_authorization_page(self.driver)
        self.go_restore_page(self.driver)
        self.click_to_phone(self.driver)

        phone, sent_passwd_button = self.get_data_restore(self.driver)
        user = databases.db1.accounting.get_users_with_status()[0]
        AccountingMethods.save_user_password(user_id=user["id"], hash_passwd=user["code_value"], salt=user["salt"])
        default_new_passwd = AccountingMethods.get_default_password(4)
        override_passwd_hash = generate_sha256(default_new_passwd, user["salt"])
        databases.db1.accounting.update_passwd_hash_by_phone(passwd_hash=override_passwd_hash, phone=user["phone"])

        # вводим номер телефона
        phone.send_keys(user["phone"][1:])
        self.click_button(sent_passwd_button)
        self.check_password_is_sent(self.driver)

        pass_input = self.get_pass_input(self.driver)
        submit_button = self.get_login(self.driver)

        self.check_form_sent_passwd(self.get_form_note(self.driver))

        pass_input.send_keys(password[1])
        submit_button.click()

        time.sleep(1)
        self.check_need_password(self.driver)
开发者ID:Maksim1988,项目名称:test,代码行数:34,代码来源:test_restore.py

示例13: setUp

# 需要导入模块: from tests.worker_accounting.class_accounting import AccountingMethods [as 别名]
# 或者: from tests.worker_accounting.class_accounting.AccountingMethods import save_user_password [as 别名]
    def setUp(cls):
        # Настройка окружения и вспомогательные параметры
        default_user_id = AccountingMethods.get_default_user_id(role='seller')
        cls.user = databases.db1.accounting.get_user_by_account_id(default_user_id)[0]
        databases.db1.accounting.update_account_details_by_criteria(default_user_id, "locale='ru'")
        AccountingMethods.save_user_password(user_id=cls.user["id"], hash_passwd=cls.user["code_value"],
                                             salt=cls.user["salt"])

        # Подготовка работы с selenium
        cls.driver = HelpLifeCycleCheckMethods.get_driver()
        service_log.preparing_env(cls)
开发者ID:Maksim1988,项目名称:test,代码行数:13,代码来源:test_store_description.py

示例14: setUp

# 需要导入模块: from tests.worker_accounting.class_accounting import AccountingMethods [as 别名]
# 或者: from tests.worker_accounting.class_accounting.AccountingMethods import save_user_password [as 别名]
    def setUp(cls):
        # Заданные параметры
        cls.type_phone = "PHONE_VALID"

        # Настройка окружения и вспомогательные параметры
        user_id = AccountingMethods.get_default_user_id()
        cls.user = databases.db1.accounting.get_user_by_criteria_only(criteria="id=%s" % user_id)[0]
        AccountingMethods.save_user_password(user_id=cls.user["id"], hash_passwd=cls.user["code_value"])

        # Подготовка работы с selenium
        cls.driver = cls.get_driver()
        service_log.preparing_env(cls)
开发者ID:Maksim1988,项目名称:test,代码行数:14,代码来源:test_authorization.py

示例15: auth

# 需要导入模块: from tests.worker_accounting.class_accounting import AccountingMethods [as 别名]
# 或者: from tests.worker_accounting.class_accounting.AccountingMethods import save_user_password [as 别名]
    def auth(self, role):
        # Настройка окружения и вспомогательные параметры
        self.default_user_id = AccountingMethods.get_default_user_id(role=role)
        databases.db1.accounting.update_account_details_by_criteria(self.default_user_id, "locale='ru'")
        self.user = databases.db1.accounting.get_user_by_account_id(self.default_user_id)[0]
        AccountingMethods.save_user_password(user_id=self.user["id"], hash_passwd=self.user["code_value"])

        # Устанавливаем новый пароль для пользователя
        self.default_new_passwd = AccountingMethods.get_default_password()
        hash_res_new = generate_sha256(self.default_new_passwd, self.user["salt"])
        databases.db1.accounting.update_user_password(self.user["id"], hash_res_new)
        self.go_main(self.driver, phone=self.user["phone"], passwd=self.default_new_passwd, flag_auth=True)
        return self.user
开发者ID:Maksim1988,项目名称:test,代码行数:15,代码来源:test_main_menu.py


注:本文中的tests.worker_accounting.class_accounting.AccountingMethods.save_user_password方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。