diff options
| author | Jocelyn Delalande <jocelyn@crapouillou.net> | 2017-03-29 15:31:28 +0200 |
|---|---|---|
| committer | Jocelyn Delalande <jocelyn@crapouillou.net> | 2017-03-29 15:31:28 +0200 |
| commit | 95d0c71827502f6e5ab0f5280176d07725073858 (patch) | |
| tree | 613b07689687c9f14c5622f5b1f96ccc5ebb49cb /budget/tests.py | |
| parent | f6236b43ca5556c6df764e95428d5efced8ff4e1 (diff) | |
| download | ihatemoney-mirror-95d0c71827502f6e5ab0f5280176d07725073858.zip ihatemoney-mirror-95d0c71827502f6e5ab0f5280176d07725073858.tar.gz ihatemoney-mirror-95d0c71827502f6e5ab0f5280176d07725073858.tar.bz2 | |
Use propper base64 encoding version for py3
Removes py3-only warning (this alias might be removed in future py3 version):
> DeprecationWarning: encodestring() is a deprecated alias, use encodebytes()
> ('%s:%s' % (username, password)).encode('utf-8')).decode('utf-8').replace('\n', '')
py2-compatible change.
Diffstat (limited to 'budget/tests.py')
| -rw-r--r-- | budget/tests.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/budget/tests.py b/budget/tests.py index 50c01ae..854c07b 100644 --- a/budget/tests.py +++ b/budget/tests.py @@ -5,7 +5,6 @@ try: except ImportError: import unittest # NOQA -import base64 import os import json from collections import defaultdict @@ -17,6 +16,7 @@ from flask import session import run import models +import utils class TestCase(unittest.TestCase): @@ -759,7 +759,7 @@ class APITestCase(TestCase): def get_auth(self, username, password=None): password = password or username - base64string = base64.encodestring( + base64string = utils.base64_encode( ('%s:%s' % (username, password)).encode('utf-8')).decode('utf-8').replace('\n', '') return {"Authorization": "Basic %s" % base64string} |
