def test_post(self, super_mock): """ Test :py:meth:`.BaseCreateView.post`. """ super_class = Mock() super_class.post.return_value = 'post-response' super_mock.return_value = super_class view = BaseCreateView() view.object = 'foo' self.assertEqual('post-response', view.post('something', foo='bar')) self.assertEqual(None, view.object) super_class.post.assert_called_once_with('something', foo='bar')
def test_inherited_classes(self): """ Test that this class inherits from the right classes. """ for class_obj in [ModelFormMixin, ProcessFormMixin, View]: self.assertIn(class_obj, BaseCreateView.mro())