<commit_before>from model.user import User


def test_add_user(app):
    # формирование старого списка пользователей
    old_user_list = app.user.get_user_list()
    # данные для нового контакта
    contact = User(firstname="Sherlock", lastname="Holmes",
                   address="221b, Baker Street, London, UK", email="<EMAIL>",
                   email2="<EMAIL>", email3="<EMAIL>", homephone="321-32-13",
                   mobilephone="+441712223355", workphone="123 12 31", additionalphone="+(44)1715553322")
    # добавление контакта<commit_msg>Параметризован тест для добавления контакта<commit_after>from model.user import User
import pytest
import random
import string


def random_str(prefix, maxlen):
    symbols = string.ascii_letters + string.digits + " "*10
    return prefix + ": " + "".join([random.choice(symbols) for i in range(random.randrange(maxlen))])


def random_phone(maxlen):
    symbols = string.digits + "(" + ")" + "-" + "+" + " "
    return "".join([random.choice(symbols) for i in range(random.randrange(maxlen))])


testdata = [User(firstname="", lastname="", address="", email="", email2="", email3="", homephone="", mobilephone="",
                 workphone="", additionalphone="")] + \
           [User(firstname=random_str("firstname", 10), lastname=random_str("lastname", 20),
                 address=random_str("address", 70), email=random_str("email", 20), email2=random_str("email2", 20),
                 email3=random_str("email3", 20), homephone=random_phone(10), mobilephone=random_phone(10),
                 workphone=random_phone(10), additionalphone=random_phone(10))for i in range(5)]


@pytest.mark.parametrize("contact", testdata, ids=[repr(x) for x in testdata])
def test_add_user(app, contact):
    old_user_list = app.user.get_user_list()
    # добавление контакта
{'fraction_non_alphanumeric': 0.15359297860669227, 'fraction_numerical': 0.039495337356006584, 'mean_word_length': 4.109243697478991, 'pattern_counts': {'":': 1, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5178695', 'n_tokens_mistral': 633, 'n_tokens_neox': 598, 'n_words': 116}