# The test code says Assertion Error: 404! = 200, but it is displayed. Which is wrong?

**URL:** <https://forum.djangoproject.com/t/the-test-code-says-assertion-error-404-200-but-it-is-displayed-which-is-wrong/12692>\
**Category:** Using Django\
**Created:** [March 19, 2022, 1:05pm UTC](https://forum.djangoproject.com/t/the-test-code-says-assertion-error-404-200-but-it-is-displayed-which-is-wrong/12692 "2022-03-19T13:05:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ggggg](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/ggggg/32/6969_2.png) [@ggggg](https://forum.djangoproject.com/u/ggggg)\
**Post date:** [March 19, 2022, 1:05pm UTC](https://forum.djangoproject.com/t/the-test-code-says-assertion-error-404-200-but-it-is-displayed-which-is-wrong/12692/1 "2022-03-19T13:05:11Z")

</div>

An error of AssertionError: 404! = 200 occurs in the test code. When actually starting and accessing, the character (haaaaaaa) is displayed and the title is changed to kaaa.  
However, it didn’t work perfectly and I failed to give css. I don’t know if these two phenomena are the same cause. I want to know the cause.

test code

```auto
    def test_testtem_view(self):
        response = self.client.get(self.test_tem_url)
        self.assertEqual(response.status_code, 200)
        self.assertTemplateUsed(response, 'test_tem2.html')

```

view code + html

```auto
def test_tem(request):
    my_dict={"title":"kaaa"}
    return render(request,'test_tem2.html',my_dict)

```

```auto
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>{{title}}</title>
</head>
<body>
	<p>haaaaaaaaaaaaaa</p>
</body>
</html>

```

Code that adapts css for the time being This should not be wrong

```auto
<link rel="stylesheet" href="{% static 'css/test_tem.css' %}">

```

```auto
Invalid block tag on line 8: 'static'. Did you forget to register or load this tag?

```
