Complete the code to import the Django test class used for database tests.
from django.test import [1]
The TestCase class is used for tests that require database access in Django.
Complete the code to import the Django test class used for tests without database access.
from django.test import [1]
The SimpleTestCase class is used for tests that do not require database access.
Fix the error in the test class declaration to correctly use SimpleTestCase.
class MyTests([1]): def test_example(self): self.assertEqual(1 + 1, 2)
To run tests without database setup, inherit from SimpleTestCase.
Fill both blanks to create a test method that uses Django's test client to get the home page.
class HomePageTests([1]): def test_home_page_status(self): response = self.client.[2]('/') self.assertEqual(response.status_code, 200)
Use TestCase to access the test client and get to request the home page.
Fill all three blanks to create a SimpleTestCase that checks if a utility function returns True.
from django.test import [1] def is_even(n): return n % 2 == 0 class UtilityTests([2]): def test_is_even(self): self.assert[3](is_even(4))
Import and inherit from SimpleTestCase for non-database tests and use assertTrue to check the function returns True.