[ckan-changes] commit/ckan: dread: [tests][xs]: Make test tolerant to different version of webob on buildbot.
Bitbucket
commits-noreply at bitbucket.org
Mon Sep 12 15:43:09 UTC 2011
1 new changeset in ckan:
http://bitbucket.org/okfn/ckan/changeset/407cea3921b9/
changeset: 407cea3921b9
branch: release-v1.4.3
user: dread
date: 2011-09-12 17:21:04
summary: [tests][xs]: Make test tolerant to different version of webob on buildbot.
affected #: 1 file (43 bytes)
--- a/ckan/tests/functional/test_user.py Fri Sep 09 19:43:55 2011 +0100
+++ b/ckan/tests/functional/test_user.py Mon Sep 12 16:21:04 2011 +0100
@@ -186,9 +186,12 @@
assert len(user.apikey) == 36
# check cookie created
- assert 'ckan_display_name="testlogin"' in res.request.environ['HTTP_COOKIE'], res.request.environ['HTTP_COOKIE']
- assert 'auth_tkt="' in res.request.environ['HTTP_COOKIE'], res.request.environ['HTTP_COOKIE']
- assert 'testlogin!userid_type:unicode"' in res.request.environ['HTTP_COOKIE'], res.request.environ['HTTP_COOKIE']
+ cookie = res.request.environ['HTTP_COOKIE']
+ # I think some versions of webob do not produce quotes, hence the 'or'
+ assert 'ckan_display_name="testlogin"' in cookie or \
+ 'ckan_display_name=testlogin' in cookie, cookie
+ assert 'auth_tkt=' in cookie, cookie
+ assert 'testlogin!userid_type:unicode' in cookie, cookie
def test_login_wrong_password(self):
# create test user
@@ -298,9 +301,12 @@
assert_equal(rev_id_before_test, rev_id_after_test)
# check cookies created
- assert 'ckan_display_name="Test Create"' in res.request.environ['HTTP_COOKIE'], res.request.environ['HTTP_COOKIE']
- assert 'auth_tkt="' in res.request.environ['HTTP_COOKIE'], res.request.environ['HTTP_COOKIE']
- assert 'testcreate!userid_type:unicode"' in res.request.environ['HTTP_COOKIE'], res.request.environ['HTTP_COOKIE']
+ cookie = res.request.environ['HTTP_COOKIE']
+ # I think some versions of webob do not produce quotes, hence the 'or'
+ assert 'ckan_display_name="Test Create"' in cookie or\
+ 'ckan_display_name=Test Create' in cookie, cookie
+ assert 'auth_tkt=' in cookie, cookie
+ assert 'testcreate!userid_type:unicode' in cookie, cookie
def test_user_create_unicode(self):
Repository URL: https://bitbucket.org/okfn/ckan/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the ckan-changes
mailing list