-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use flask.test_client instead of webtest.test_app
- Loading branch information
1 parent
8084463
commit bde93da
Showing
5 changed files
with
48 additions
and
97 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,13 +1,13 @@ | ||
# encoding: utf-8 | ||
|
||
import pytest | ||
|
||
from ckan.tests.helpers import body_contains | ||
|
||
@pytest.mark.ckan_config(u"ckan.root_path", u"/data/{{LANG}}") | ||
@pytest.mark.ckan_config(u"ckan.plugins", u"example_theme_v15_fanstatic") | ||
@pytest.mark.usefixtures(u"with_plugins") | ||
def test_resource_url(app): | ||
content = app.get(u"/") | ||
if u"example_theme.css" not in content: | ||
assert u"example_theme.min.css" in content | ||
assert u'href="/data/webassets/example_theme' in content | ||
if not body_contains(content, u"example_theme.css"): | ||
assert body_contains(content, u"example_theme.min.css") | ||
assert body_contains(content, u'href="/data/webassets/example_theme') |
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,9 +1,11 @@ | ||
# encoding: utf-8 | ||
|
||
from ckan.tests.helpers import body_contains | ||
|
||
def test_robots_txt(app): | ||
response = app.get(u"/robots.txt", status=200) | ||
res = app.get(u"/robots.txt") | ||
assert res.status_code == 200 | ||
assert ( | ||
response.headers.get(u"Content-Type") == u"text/plain; charset=utf-8" | ||
res.headers.get(u"Content-Type") == u"text/plain; charset=utf-8" | ||
) | ||
assert u"User-agent" in response | ||
assert body_contains(res, u"User-agent") |