Skip to content

Commit

Permalink
fix(workflow): attempt to prevent cache in new user webfrom tests;
Browse files Browse the repository at this point in the history
- Set remote user to blank for user webform tests.
  • Loading branch information
JVickery-TBS committed Sep 6, 2023
1 parent eca2647 commit 9aafb77
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ckanext/canada/tests/test_webforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,17 +183,19 @@ def setup_method(self, method):
Setup any state specific to the execution of the given class methods.
"""
super(TestNewUserWebForms, self).setup_method(method)
self.extra_environ_tester = {'REMOTE_USER': str(u"")}
self.org = Organization()


def test_new_user_required_fields(self, app):
offset = h.url_for('user.register')
response = app.get(offset)
response = app.get(offset, extra_environ=self.extra_environ_tester)

assert 'Request an Account' in response.body

response = app.post(offset,
data=self._filled_new_user_form(),
extra_environ=self.extra_environ_tester,
follow_redirects=True)

assert 'Account Created' in response.body
Expand All @@ -202,7 +204,7 @@ def test_new_user_required_fields(self, app):

def test_new_user_missing_fields(self, app):
offset = h.url_for('user.register')
response = app.get(offset)
response = app.get(offset, extra_environ=self.extra_environ_tester)

assert 'Request an Account' in response.body

Expand All @@ -214,6 +216,7 @@ def test_new_user_missing_fields(self, app):
}
response = app.post(offset,
data=incomplete_new_user_form,
extra_environ=self.extra_environ_tester,
follow_redirects=True)

assert 'The form contains invalid entries' in response.body
Expand Down

0 comments on commit 9aafb77

Please sign in to comment.