Py3: don't use mock.assert_called_once implemented in 3.6.

This commit is contained in:
Dmitry Kuzmenko 2017-06-20 16:34:22 +03:00
parent e079b4657a
commit 9de940d3d3

View File

@ -189,7 +189,7 @@ class DjangomodCliCommandTestCase(TestCase, LoaderModuleMockMixin):
djangomod.createsuperuser(
'settings.py', 'testuser', 'user@example.com'
)
mock.assert_called_once()
self.assertEqual(mock.call_count, 1)
args, kwargs = mock.call_args
# cmdline arguments are extracted from a kwargs dict so order isn't guaranteed.
self.assertEqual(len(args), 1)