---
title: "Discussion on \"About self.subTest\" | Hashnode"
description: "Discussion on \"About self.subTest\". self.subTest is a part of Django's TestCase class and is used as follows:\ndef test_a_view(self):\n    response = self.client.get(url)\n\n    with self.subTest(\"Response status code\"):\n        self.assertEqual(response.status_code, 200)\n\n    with self.su..."
url: "https://hashnode.com/posts/about-selfsubtest/610ab9a30e53fb566c75fc67"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [About self.subTest](https://til.justinthurman.dev/about-selfsubtest?utm_source=hashnode&utm_medium=feed)

self.subTest is a part of Django's TestCase class and is used as follows: def test\_a\_view(self): response = self.client.get(url) with self.subTest("Response status code"): self.assertEqual(response.status\_code, 200) with self.su...

Aug 4, 2021 · 1 min read · til.justinthurman.dev  
Read the article

-   [#django](https://hashnode.com/tag/django)
-   [#testing](https://hashnode.com/tag/testing)
-   [#python](https://hashnode.com/tag/python)

## Written by

[Justin Thurman](https://hashnode.com/@justinthurman)

@justinthurman

  
[View profile](https://hashnode.com/@justinthurman)

Software Engineer

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
