Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomáš Daniel committed Mar 27, 2024
1 parent cb6254c commit e91d5b7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions germanium/tools/http.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from urllib.parse import urlencode

from django.utils.encoding import force_text
from django.utils.encoding import force_str

from .trivials import assert_equal, assert_in


def get_full_path(*paths):
string_paths = (force_text(path) for path in paths)
string_paths = (force_str(path) for path in paths)
full_path = '/'.join((path[:-1] if path.endswith('/') else path for path in string_paths))
return full_path if full_path.endswith('/') else full_path + '/'

Expand Down
4 changes: 2 additions & 2 deletions germanium/tools/rest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import json

from django.utils.encoding import force_text
from django.utils.encoding import force_str

from .trivials import assert_true, assert_equal, assert_in, fail
from .http import assert_http_ok, assert_http_created
Expand All @@ -12,7 +12,7 @@ def assert_valid_JSON(data, msg='Json is not valid'):
can be loaded properly.
"""
try:
json.loads(force_text(data))
json.loads(force_str(data))
except:
fail(msg)

Expand Down

0 comments on commit e91d5b7

Please sign in to comment.