Exemplo n.º 1
0
def _test_check_data_on_view_page(app, db):
    """Validation of all data on view page"""

    a = sorted(list(map(cleann, db.get_contact_list())), key=Contact.if_or_max)

    for i in xrange(app.contact.count()):
        contact_from_hp = map(cleann, app.contact.get_contact_info_from_view_page(i))

        assert contact_from_hp[i].home == clear(a.home)
        assert contact_from_hp[i].mobile == clear(a.mobile)
        assert contact_from_hp[i].work == clear(a.work)
        assert contact_from_hp[i].phone == clear(a.phone)

        assert contact_from_hp[i].email1 == clear(a.email1)
        assert contact_from_hp[i].email2 == clear(a.email2)
        assert contact_from_hp[i].email3 == clear(a.email3)
        assert contact_from_hp[i].address == clear(a.address)
Exemplo n.º 2
0
def test_phones_on_home_page(app):
    """
    Validation data on edit page == home page
    """
    app.contact.validation_of_contact_exist()

    contact_from_hp = app.contact.get_contact_list_without_none()
    contact_from_ep = app.contact.get_contact_info_from_edit_page(0)
    assert contact_from_hp[0].home == clear(contact_from_ep.home)
    assert contact_from_hp[0].mobile == clear(contact_from_ep.mobile)
    assert contact_from_hp[0].work == clear(contact_from_ep.work)
    assert contact_from_hp[0].phone == clear(contact_from_ep.phone)

    assert contact_from_hp[0].email1 == clear(contact_from_ep.email1)
    assert contact_from_hp[0].email2 == clear(contact_from_ep.email2)
    assert contact_from_hp[0].email3 == clear(contact_from_ep.email3)
    assert contact_from_hp[0].address == clear(contact_from_ep.address)
Exemplo n.º 3
0
def test_phones_on_home_page(app):
    """
    Validation data on edit page == home page
    """
    app.contact.validation_of_contact_exist()

    contact_from_hp = app.contact.get_contact_list_without_none()
    contact_from_ep = app.contact.get_contact_info_from_edit_page(0)
    assert contact_from_hp[0].home == clear(contact_from_ep.home)
    assert contact_from_hp[0].mobile == clear(contact_from_ep.mobile)
    assert contact_from_hp[0].work == clear(contact_from_ep.work)
    assert contact_from_hp[0].phone == clear(contact_from_ep.phone)

    assert contact_from_hp[0].email1 == clear(contact_from_ep.email1)
    assert contact_from_hp[0].email2 == clear(contact_from_ep.email2)
    assert contact_from_hp[0].email3 == clear(contact_from_ep.email3)
    assert contact_from_hp[0].address == clear(contact_from_ep.address)