From 5e4ae2fdc9f5cbec59d17ffcea877d08ae3c7dd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Leonhardt?= Date: Tue, 14 Jul 2015 14:53:14 +0200 Subject: [PATCH] Changed assertCalledOnceWith() to assert_called_once_with() When I change assertCalledOnceWith() to assert_called_once_with(), make test succeeds but shows another failure: ``` AssertionError: Expected call: mock(sentinel.size, sentinel.modified_time) Actual call: mock(sentinel.since, sentinel.modified_time, sentinel.size) ``` After changing the call accordingly, all 59 tests succeed. --- tests/views.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/views.py b/tests/views.py index c6c9517..bfa9aa7 100644 --- a/tests/views.py +++ b/tests/views.py @@ -75,7 +75,7 @@ class DownloadMixinTestCase(unittest.TestCase): self.assertIs( mixin.was_modified_since(file_wrapper, mock.sentinel.since), mock.sentinel.was_modified) - file_wrapper.was_modified_since.assertCalledOnceWith( + file_wrapper.was_modified_since.assert_called_once_with( mock.sentinel.since) def test_was_modified_since_django(self): @@ -101,9 +101,10 @@ class DownloadMixinTestCase(unittest.TestCase): self.assertIs( mixin.was_modified_since(file_wrapper, mock.sentinel.since), mock.sentinel.was_modified) - was_modified_since_mock.assertCalledOnceWith( - mock.sentinel.size, - mock.sentinel.modified_time) + was_modified_since_mock.assert_called_once_with( + mock.sentinel.since, + mock.sentinel.modified_time, + mock.sentinel.size) def test_was_modified_since_fallback(self): """DownloadMixin.was_modified_since() fallbacks to `True`.