﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
34947	assertContains fails when there is unicode in the response json	ideesnoires	nobody	"{{{
#views.py

class Umlaut(View):
    def get(self, request):
        return JsonResponse({""uml"": ""äuuuß""})

#tests.py

class UmlautTest(TestCase):
    def test_contains(self):
        response = self.client.get('/')
        self.assertContains(response, 'ä')

# produces:
======================================================================
FAIL: test_contains (app.tests.UmlautTest.test_contains)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ""/Users/markus/dev/testcase/p/app/tests.py"", line 6, in test_contains
    self.assertContains(response, 'ä')
  File ""/Users/markus/Library/Caches/pypoetry/virtualenvs/testcase-H5bBokyv-py3.12/lib/python3.12/site-packages/django/test/testcases.py"", line 660, in assertContains
    self.assertTrue(
AssertionError: False is not true : Couldn't find 'ä' in response

----------------------------------------------------------------------
Ran 1 test in 0.002s

FAILED (failures=1)

#but is succesful when checking for 'uuu'
}}}"	Bug	closed	Testing framework	4.2	Normal	invalid	unicode, testing, assertcontains		Unreviewed	0	0	0	0	0	0
