def test_replace_pointers_with_objects(): p = Project() e1 = Entity(p, title="e1", a=1, b=2) e2 = Entity(p, title="e2", a=2, b=3) e1['friend'] = e2.uuid e1.replace_pointers_with_objects() assert e1['friend'] == e2, e1['friend']
def test_2(self): p = Project() est1 = Entity(p, title='4 days') est1_uuid = est1.uuid e1 = Entity(p, title='some task', estimate=est1) e1.replace_objects_with_pointers() est2 = Entity(p, title=est1.title, uuid=uuid.uuid4()) assert est2 is est1 assert est1_uuid != est2.uuid e2 = Entity(p, title='another task', estimate=est2) e2.replace_objects_with_pointers() assert e1['estimate'] != e2['estimate'], est2['estimate'] e1.replace_pointers_with_objects() e2.replace_pointers_with_objects() assert e1['estimate'] == e2['estimate'], est2['estimate']
def test_no_project(): e = Entity(title="blah123") print(e.project) e.replace_pointers_with_objects()