use different ports for jwt tests
This commit is contained in:
parent
4d7a775dce
commit
432c33209d
1 changed files with 6 additions and 0 deletions
|
@ -12,6 +12,8 @@ from tempfile import NamedTemporaryFile
|
||||||
from Crypto.PublicKey import RSA
|
from Crypto.PublicKey import RSA
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
|
|
||||||
|
_PORT_NUMBER = 5001
|
||||||
|
|
||||||
class JWTAuthTestCase(LiveServerTestCase):
|
class JWTAuthTestCase(LiveServerTestCase):
|
||||||
maxDiff = None
|
maxDiff = None
|
||||||
|
|
||||||
|
@ -30,6 +32,9 @@ class JWTAuthTestCase(LiveServerTestCase):
|
||||||
JWTAuthTestCase.private_key_data = private_key_data
|
JWTAuthTestCase.private_key_data = private_key_data
|
||||||
|
|
||||||
def create_app(self):
|
def create_app(self):
|
||||||
|
global _PORT_NUMBER
|
||||||
|
_PORT_NUMBER = _PORT_NUMBER + 1
|
||||||
|
|
||||||
users = [
|
users = [
|
||||||
{'name': 'cooluser', 'email': 'user@domain.com', 'password': 'password'},
|
{'name': 'cooluser', 'email': 'user@domain.com', 'password': 'password'},
|
||||||
{'name': 'some.neat.user', 'email': 'neat@domain.com', 'password': 'foobar'}
|
{'name': 'some.neat.user', 'email': 'neat@domain.com', 'password': 'foobar'}
|
||||||
|
@ -37,6 +42,7 @@ class JWTAuthTestCase(LiveServerTestCase):
|
||||||
|
|
||||||
jwt_app = Flask('testjwt')
|
jwt_app = Flask('testjwt')
|
||||||
private_key = JWTAuthTestCase.private_key_data
|
private_key = JWTAuthTestCase.private_key_data
|
||||||
|
jwt_app.config['LIVESERVER_PORT'] = _PORT_NUMBER
|
||||||
|
|
||||||
def _get_basic_auth():
|
def _get_basic_auth():
|
||||||
data = base64.b64decode(request.headers['Authorization'][len('Basic '):])
|
data = base64.b64decode(request.headers['Authorization'][len('Basic '):])
|
||||||
|
|
Reference in a new issue