-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/python3.10' into develop
- Loading branch information
Showing
163 changed files
with
3,179 additions
and
48,039 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ on: | |
|
||
jobs: | ||
gen_docs: | ||
name: generate DOAJ documentation and fuctional tests and push to the docs repo | ||
name: generate DOAJ documentation and functional tests and push to the docs repo | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
|
@@ -16,22 +16,22 @@ jobs: | |
|
||
steps: | ||
- name: checkout the branch of interest | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
with: | ||
path: doaj | ||
|
||
- name: checkout the documentation repo | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
with: | ||
path: doaj-docs | ||
repository: DOAJ/doaj-docs | ||
token: ${{ secrets.STEVE_PAT_DOAJ_ACTIONS_DOCS }} | ||
fetch-depth: 0 | ||
|
||
- name: set up a python 3.8 environment | ||
uses: actions/setup-python@v4.4.0 | ||
- name: set up a python 3.10 environment | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.8 | ||
python-version: '3.10' | ||
|
||
- name: install elasticsearch | ||
uses: getong/[email protected] | ||
|
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 +1 @@ | ||
3.8.10 | ||
3.10 |
This file was deleted.
Oops, something went wrong.
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,7 +1,7 @@ | ||
from flask import Response | ||
|
||
from doajtest import helpers | ||
from doajtest.helpers import DoajTestCase, with_es | ||
from doajtest.helpers import DoajTestCase | ||
from portality import models | ||
from portality.core import load_account_for_login_manager | ||
from portality.decorators import api_key_required, api_key_optional | ||
|
@@ -13,8 +13,17 @@ def setUpClass(cls): | |
super(TestAPIClient, cls).setUpClass() | ||
helpers.initialise_index() | ||
|
||
# Turn off debug so we're allowed to add these routes after the app has been used in other tests | ||
# Turn off debug and so we're allowed to add these routes after the app has been used in other tests | ||
cls.app_test.debug = False | ||
cls.app_test.testing = False | ||
|
||
"""This is a lie, but it allows us to circumnavigate a check to prevent routes being added after first request: | ||
AssertionError: The setup method 'route' can no longer be called on the application. It has already handled its | ||
first request, any changes will not be applied consistently. | ||
Make sure all imports, decorators, functions, etc. needed to set up the application are done before running it. | ||
""" | ||
cls.app_test._got_first_request = False | ||
|
||
@cls.app_test.route('/hello') | ||
@api_key_required | ||
|
@@ -36,7 +45,6 @@ def tearDownClass(cls) -> None: | |
# put debug back on | ||
cls.app_test.debug = True | ||
|
||
#@with_es(indices=[models.Account.__type__]) | ||
def test_01_api_role(self): | ||
"""test the new roles added for the API""" | ||
a1 = models.Account.make_account(email="[email protected]", username="a1_user", name="a1_name", | ||
|
@@ -55,7 +63,6 @@ def test_01_api_role(self): | |
a1.remove_role('api') | ||
assert a1.api_key is None | ||
|
||
#@with_es(indices=[models.Account.__type__]) | ||
def test_02_api_required_decorator(self): | ||
"""test the api_key_required decorator""" | ||
a1 = models.Account.make_account(email="[email protected]", username="a1_user", name="a1_name", | ||
|
@@ -78,7 +85,6 @@ def test_02_api_required_decorator(self): | |
response_denied = t_client.get('/hello?api_key=' + a2_key) | ||
assert response_denied.status_code == 401 | ||
|
||
#@with_es(indices=[models.Account.__type__, models.Journal.__type__, models.Article.__type__]) | ||
def test_03_api_optional_decorator(self): | ||
"""test the api_key_optional decorator""" | ||
a1 = models.Account.make_account(email="[email protected]", username="a1_user", name="a1_name", | ||
|
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
Oops, something went wrong.