Skip to content

Commit

Permalink
Merge pull request #1403 from open-data/fix/github-tests-system-depends
Browse files Browse the repository at this point in the history
Fix Github Tests
  • Loading branch information
JVickery-TBS authored Sep 6, 2023
2 parents dfbe73d + 9d769ff commit a286716
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ jobs:
git --git-dir=\/srv\/app\/src\/ckan\/.git --work-tree=\/srv\/app\/src\/ckan\/ pull
- name: Install requirements
run: |
apk add jpeg-dev
pip install setuptools==36.1
pip install --upgrade pip==19.2.1
pip install -e \/srv\/app\/src\/ckan\/ -r \/srv\/app\/src\/ckan\/requirements-py2.txt -r \/srv\/app\/src\/ckan\/dev-requirements.txt
Expand Down
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
3 changes: 3 additions & 0 deletions test-core.ini
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ ckan.plugins =
# no default views for tests...
# ckan.views.default_views = []

# we have tests for web user registration form
ckan.auth.create_user_via_web = true

#ckan.tracking_enabled = true
ckan.site_logo = /img/logo_64px_wide.png
ckan.favicon = /images/icons/ckan.ico
Expand Down

0 comments on commit a286716

Please sign in to comment.