Skip to content

Commit 76ea761

Browse files
committed
Not test parameters for add and not clear database
1 parent 4f78d2d commit 76ea761

1 file changed

Lines changed: 5 additions & 12 deletions

File tree

morepath_sqlalchemy/tests/test_sqlalchemy.py

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
def setup_module(module):
1313
engine = sqlalchemy.create_engine('sqlite:///:memory:')
1414
Session.configure(bind=engine)
15-
Base.metadata.drop_all(engine)
1615
Base.metadata.create_all(engine)
1716

1817
morepath.disable_implicit()
@@ -26,9 +25,7 @@ def test_documents():
2625
collection_response = c.get('/documents')
2726

2827
assert collection_response.json["documents"] == []
29-
assert "http://localhost/documents/add?" in collection_response.json["add"]
30-
assert "limit=10" in collection_response.json["add"]
31-
assert "offset=0" in collection_response.json["add"]
28+
assert "http://localhost/documents/add" in collection_response.json["add"]
3229
assert collection_response.json["previous"] is None
3330
assert collection_response.json["next"] is None
3431

@@ -72,11 +69,9 @@ def test_previous_next():
7269
}]
7370

7471
assert response.json["documents"] == expected_documents
75-
assert "http://localhost/documents/add?" in response.json["add"]
76-
assert "limit=1" in response.json["add"]
77-
assert "offset=0" in response.json["add"]
72+
assert "http://localhost/documents/add" in response.json["add"]
7873
assert response.json["previous"] is None
79-
assert "http://localhost/documents?" in response.json["next"]
74+
assert "http://localhost/documents" in response.json["next"]
8075
assert "limit=1" in response.json["next"]
8176
assert "offset=1" in response.json["next"]
8277

@@ -89,10 +84,8 @@ def test_previous_next():
8984
}]
9085

9186
assert response.json["documents"] == expected_documents
92-
assert "http://localhost/documents/add?" in response.json["add"]
93-
assert "limit=1" in response.json["add"]
94-
assert "offset=1" in response.json["add"]
95-
assert "http://localhost/documents?" in response.json["previous"]
87+
assert "http://localhost/documents/add" in response.json["add"]
88+
assert "http://localhost/documents" in response.json["previous"]
9689
assert "limit=1" in response.json["previous"]
9790
assert "offset=0" in response.json["previous"]
9891
assert response.json["next"] is None

0 commit comments

Comments
 (0)