Selaa lähdekoodia

Fixes second test failing

Ask Solem 9 vuotta sitten
vanhempi
commit
782817000b

+ 2 - 2
celery/tests/events/test_events.py

@@ -120,9 +120,9 @@ class test_EventDispatcher(AppCase):
         eventer.on_send_buffered.assert_called_with()
         eventer.send('task-received', uuid=1)
         self.assertFalse(eventer._group_buffer['task'])
-        eventer._publish.assert_has_calls(
+        eventer._publish.assert_has_calls([
             call([], eventer.producer, 'task.multi'),
-        )
+        ])
         # clear in place
         self.assertIs(eventer._group_buffer['task'], prev_buffer)
         self.assertEqual(len(buf_received[0]), 2)

+ 3 - 2
celery/tests/fixups/test_django.py

@@ -60,8 +60,9 @@ class test_DjangoFixup(FixupCase):
         f._settings = Mock(name='_settings')
         self.assertIs(f.autodiscover_tasks(), f._settings.INSTALLED_APPS)
 
-    @patch('django.apps.apps', create=True)
-    def test_autodiscover_tasks(self, apps):
+    def test_autodiscover_tasks(self):
+        self.mock_modules('django.apps')
+        from django.apps import apps
         f = DjangoFixup(self.app)
         configs = [Mock(name='c1'), Mock(name='c2')]
         apps.get_app_configs.return_value = configs

+ 1 - 1
celery/tests/utils/test_timer2.py

@@ -150,7 +150,7 @@ class test_Timer(Case):
         self.on_nth_call_do(ne, t._is_shutdown.set, 3)
         t.run()
         sleep.assert_called_with(3.33)
-        on_tick.assert_has_class(call(3.33), call(3.33), call(3.33))
+        on_tick.assert_has_calls([call(3.33), call(3.33), call(3.33)])
 
     @redirect_stdouts
     def test_apply_entry_error_not_handled(self, stdout, stderr):