modeltests.validation - TypeError: Can't convert 'bytes' object to str implicitly

Issue #45 resolved
Joel Crocker created an issue

{{{

!python

====================================================================== ERROR: test_wrong_url_value_raises_error (modeltests.validation.tests.BaseModelValidationTests)


Traceback (most recent call last): File "/usr/local/lib/python3.1/site-packages/django/core/validators.py", line 58, in call super(URLValidator, self).call(value) File "/usr/local/lib/python3.1/site-packages/django/core/validators.py", line 39, in call raise ValidationError(self.message, code=self.code) django.core.exceptions.ValidationError: ['Enter a valid value.']

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/joel/csc302/django-3k/build/tests/modeltests/validation/tests.py", line 53, in test_wrong_url_value_raises_error self.assertFieldFailsValidationWithMessage(mtv.full_clean, 'url', ['Enter a valid value.']) File "/home/joel/csc302/django-3k/build/tests/modeltests/validation/init.py", line 14, in assertFieldFailsValidationWithMessage self.assertRaises(ValidationError, clean) File "/usr/local/lib/python3.1/unittest.py", line 589, in assertRaises callableObj(args, *kwargs) File "/usr/local/lib/python3.1/site-packages/django/db/models/base.py", line 822, in full_clean self.clean_fields(exclude=exclude) File "/usr/local/lib/python3.1/site-packages/django/db/models/base.py", line 863, in clean_fields setattr(self, f.attname, f.clean(raw_value, self)) File "/usr/local/lib/python3.1/site-packages/django/db/models/fields/init.py", line 227, in clean self.run_validators(value) File "/usr/local/lib/python3.1/site-packages/django/db/models/fields/init.py", line 182, in run_validators v(value) File "/usr/local/lib/python3.1/site-packages/django/core/validators.py", line 69, in call value = value.replace(splitted[1], netloc_ace) TypeError: Can't convert 'bytes' object to str implicitly


}}}

Comments (1)

  1. Log in to comment