Complete the code to import the Django test case class.
from django.test import [1]
The TestCase class is used to write tests in Django.
Complete the code to define a test method inside a Django test case.
class MyModelTest(TestCase): def [1](self): pass
Test methods in Django must start with test_ to be recognized.
Fix the error in the test method to correctly create a model instance.
def test_create_user(self): user = User.objects.[1](username='alice') self.assertEqual(user.username, 'alice')
Use create to make a new model instance in the database during tests.
Fill both blanks to assert that the model instance count is 1 after creation.
def test_user_count(self): User.objects.create(username='bob') count = User.objects.[1]().[2]() self.assertEqual(count, 1)
Use all() to get all objects and count() to count them.
Fill all three blanks to test that a model's string representation matches the username.
def test_str_method(self): user = User.objects.create(username='carol') self.assertEqual(str([1]), [2]) self.assertEqual(user.[3](), 'carol')
Convert the user object to string, compare to username string, and call the __str__ method.
