<filename>test/test_del_addres.py<gh_stars>0
# -*- coding: utf-8 -*-
from model.addres import Addres
import random

def test_delete_some_address2(app, db, check_ui):
    if len(db.get_addres_list()) == 0:
       app.addres.create(Addres(firstname="nnnnnnnnnnnnn", middlename="cccccccccc", lastname="tttgggttttt"))
    old_addres = db.get_addres_list()
    addres = random.choice(old_addres)
    app.addres.delete_addres_by_id(addres.id)
    new_addres = db.get_addres_list()
    assert len(old_addres) - 1 == app.addres.count()
    old_addres.remove(addres)
    #assert old_addres == new_addres
    if check_ui:
        assert sorted(new_addres, key=Addres.id_or_max)== sorted(app.addres.get_addres_list())

<filename>test/test_del_addres.py<gh_stars>0
# -*- coding: utf-8 -*-
from model.addres import Addres
import random

def test_delete_some_address2(app, db, check_ui):
    if len(db.get_addres_list()) == 0:
       app.addres.create(Addres(firstname="nnnnnnnnnnnnn", middlename="cccccccccc", lastname="tttgggttttt"))
    old_addres = db.get_addres_list()
    addres = random.choice(old_addres)
    app.addres.delete_addres_by_id(addres.id)
    new_addres = db.get_addres_list()
    assert len(old_addres) - 1 == app.addres.count()
    old_addres.remove(addres)
    #assert old_addres == new_addres
    if check_ui:
        assert sorted(new_addres, key=Addres.id_or_max)== sorted(app.addres.get_addres_list())

# -*- coding: utf-8 -*- #assert old_addres == new_addres