-
-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
161 additions
and
236 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,13 @@ | ||
"""Test using user-defined models with sandman2.""" | ||
import json | ||
|
||
from flask import url_for | ||
from pytest_flask.fixtures import client | ||
|
||
from tests.resources import ( | ||
GET_ERROR_MESSAGE, | ||
INVALID_ACTION_MESSAGE, | ||
) | ||
|
||
model_module = 'tests.automap_models' | ||
database = 'blog.sqlite3' | ||
|
||
|
||
def test_get_automap_collection(client): | ||
"""Do we see a model's __unicode__ definition being used in the admin?""" | ||
response = client.get(url_for('blog.index_view')) | ||
assert response.status_code == 200 | ||
assert 'Jeff Knupp' in response.get_data(as_text=True) | ||
res = client.get(url_for('blog.index_view')) | ||
assert res.status_code == 200 | ||
assert 'Jeff Knupp' in res |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,9 @@ | ||
"""Tests for non-core functionality in sandman2.""" | ||
|
||
from pytest_flask.fixtures import client | ||
|
||
exclude_tables = ('Invoice') | ||
|
||
def test_pagination(client): | ||
"""Do we return paginated results when a 'page' parameter is provided?""" | ||
response = client.get('/artist?page=2') | ||
assert response.status_code == 200 | ||
assert len(response.json['resources']) == 20 | ||
assert response.json['resources'][0]['ArtistId'] == 21 | ||
res = client.get('/artist?page=2') | ||
assert res.status_code == 200 | ||
assert len(res.json['resources']) == 20 | ||
assert res.json['resources'][0]['ArtistId'] == 21 |
Oops, something went wrong.