Commit 461ba022 authored by Tomas Taraba's avatar Tomas Taraba

3395 Add delete dao action

parent 1436bd3a
......@@ -35,6 +35,11 @@ def get(label_id):
return query.first()
def delete(label):
Session.delete(label)
Session.flush()
def search(**parameters):
rows, total = label_search.search(Session, parameters)
return SearchResult(total, rows)
......@@ -58,3 +58,13 @@ class TestLabelExist(DAOTestCase):
assert_that(result[1][0].users_count, equal_to(1))
assert_that(result, equal_to(expected))
def test_delete_label(self):
label_row = self.add_label()
label_dao.delete(label_row)
expected = SearchResult(total=0, items=[])
result = label_dao.search()
assert_that(result, equal_to(expected))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment