How to test a website / application using unittest? What modules to use? Preferably with code examples of such a test?

import unittest class test_website(unittest.TestCase): def test_website(self): self.assertEqual(website('http://example.org/category/page'), 'Ответ от сервера') 

    1 answer 1

    First you need to deal with the materiel: what tests are needed, for what, what tests exactly. I would advise you to read the introductory article about testing at Habré , the section about testing from Hyde Tu Python and the section about tests from the documentation for Django - this will not take more than an hour, but it should add significantly.

    For examples of tests, you can go to Gitkhab. For example, look at the tests in the sorts of mosowpython.ru .