-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8ac77c7
commit b71c429
Showing
3 changed files
with
32 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from pathlib import Path | ||
|
||
from flask import g, url_for | ||
|
||
from openatlas import app | ||
from openatlas.database import entity as db | ||
from openatlas.forms.util import form_to_datetime64 | ||
from openatlas.models.entity import Link | ||
from tests.base import TestBaseCase, get_hierarchy, insert | ||
|
||
|
||
class TokenTests(TestBaseCase): | ||
def test_token(self) -> None: | ||
c = self.client | ||
with app.test_request_context(): | ||
app.preprocess_request() | ||
|
||
|
||
rv = c.get(url_for('api_token')) | ||
assert b'Token' in rv.data | ||
|
||
rv = c.get(url_for('generate_token')) | ||
assert b'Generate token' in rv.data | ||
|
||
rv = c.post(url_for('generate_token')) | ||
assert b'Generate token' in rv.data |