jazzband / django-nose

Django test runner using nose
http://pypi.python.org/pypi/django-nose
BSD 3-Clause "New" or "Revised" License
882 stars 239 forks source link

Django 1.11 test coverage for models returning JSON object error #306

Closed kotireddy478 closed 4 years ago

kotireddy478 commented 4 years ago

Hi there,

test coverage is giving me TypeError: the JSON object must be str, not 'bytes' errors and test is failing with errors.

Please help me how to fix it?

-------------------- >> begin captured logging << -------------------- django.request: ERROR: Internal Server Error: /apps/related-info/experiment/13/related-info/ Traceback (most recent call last): File "/home/mytardis/.virtualenvs/mytardis/lib/python3.5/site-packages/django/core/handlers/exception.py", line 41, in inner response = get_response(request) File "/home/mytardis/.virtualenvs/mytardis/lib/python3.5/site-packages/django/core/handlers/base.py", line 187, in _get_response response = self.process_exception_by_middleware(e, request) File "/home/mytardis/.virtualenvs/mytardis/lib/python3.5/site-packages/django/core/handlers/base.py", line 185, in _get_response response = wrapped_callback(request, *callback_args, *callback_kwargs) File "/home/mytardis/mytardis/tardis/tardis_portal/shortcuts.py", line 137, in list_or_create return context._create(request, args, **kwargs) File "/home/mytardis/mytardis/tardis/tardis_portal/shortcuts.py", line 182, in _create form = self.form_cls(json.loads(request.body)) File "/usr/lib/python3.5/json/init.py", line 312, in loads s.class.name)) TypeError: the JSON object must be str, not 'bytes' --------------------- >> end captured logging << ---------------------

kotireddy478 commented 4 years ago

python version issue,sorted.