# -*- coding: utf-8 -*-
from model.contact import Contact
from random import randrange
import pytest
import random
import string


#@pytest.mark.parametrize("contact", testdata, ids=[repr(x) for x in testdata])

def test_add_contact1(app, json_contacts):
        contact = json_contacts
        old_contacts = app.contact.get_contact_list()
        app.contact.create(contact)
        new_contacts = app.contact.get_contact_list()
        assert len(old_contacts) + 1 == len(new_contacts)
        old_contacts.append(contact)
        assert sorted(old_contacts, key=Contact.id_or_max) == sorted(new_contacts, key=Contact.id_or_max)
