Example #1
0
    def test_unpatch_app(self):
        """
        When unpatch_app is called on a patched app
            we unpatch the `task()` method
        """
        # Assert it is patched before we start
        self.assertIsInstance(celery.Celery.task, wrapt.BoundFunctionWrapper)

        # Unpatch the app
        unpatch_app(celery.Celery)

        # Assert the method is not patched
        self.assertFalse(isinstance(celery.Celery.task, wrapt.BoundFunctionWrapper))
        self.assertFalse(isinstance(celery.Celery.Task.__init__, wrapt.BoundFunctionWrapper))
Example #2
0
    def test_unpatch_app(self):
        """
        When unpatch_app is called on a patched app
            we unpatch the `task()` method
        """
        # Assert it is patched before we start
        self.assertIsInstance(celery.Celery.task, wrapt.BoundFunctionWrapper)

        # Unpatch the app
        unpatch_app(celery.Celery)

        # Assert the method is not patched
        self.assertFalse(
            isinstance(celery.Celery.task, wrapt.BoundFunctionWrapper))
        self.assertFalse(
            isinstance(celery.Celery.Task.__init__,
                       wrapt.BoundFunctionWrapper))
Example #3
0
 def tearDown(self):
     unpatch_app(celery.Celery)
Example #4
0
 def tearDown(self):
     unpatch_app(celery.Celery)
     unpatch_task(celery.Task)
Example #5
0
 def tearDown(self):
     unpatch_app(celery.Celery)