class CreateListTest(unittest.TestCase):

    def setUp(self):
        self.request = HttpRequest()
self.request.user = Mock()
self.form = Mock()
self.view = setup_view(views.CreateList(), self.request)

def test_form_dot_save_called_with_user(self):
    self.view.form_valid(self.form)
self.form.save.assert_called_once_with(owner=self.request.user)

@patch('lists.views.redirect')
def test_redirect(self, mock_redirect):
    self.view.form_valid(self.form)
mock_redirect.assert_called_once_with(self.form.save.return_value)
Как TDD можно применить к общим представлениям на основе класса Django?