Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Yohann Gabory committed May 11, 2015
1 parent 5fa1614 commit 16ce92c
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions drunken_boat/db/postgresql/tests/test_db_projection_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,28 @@ def test_projection_update(prepare_test):
assert p == [(4,)]


def test_projection_delete(prepare_test):
projection = projections_fixtures.TestProjectionWithVirtual(get_test_db())
projection.insert(
{"title": "dummy",
"introduction": "a meaningfull introduction"})
assert projection.delete("title=%s", ("dummy",)) == []
projection.insert(
{"title": "dummy",
"introduction": "a meaningfull introduction"})
assert projection.delete(Where("title", "=", "%s"), ("dummy",)) == []
pytest.raises(ProgrammingError,
projection.delete,
Where("name", "=", "%s"), ("Pouet",))
projection.insert(
{"title": "dummy",
"introduction": "a meaningfull introduction"})
p = projection.delete(Where("title", "=", "%s"),
("dummy",),
returning="self")
assert isinstance(p[0], DataBaseObject)


def test_projection_foreign(prepare_test):
projection_author = projections_fixtures.AuthorProjection(get_test_db())
projection_author.insert(
Expand Down

0 comments on commit 16ce92c

Please sign in to comment.