Ejemplo n.º 1
0
    def test_it_finds_the_service(self, celery, user):
        worker.rename_user(user.id, 'panda')

        celery.request.find_service.assert_called_once_with(name='rename_user')
Ejemplo n.º 2
0
    def test_it_renames_the_user(self, celery, user):
        service = celery.request.find_service.return_value

        worker.rename_user(user.id, 'panda')

        service.rename.assert_called_once_with(user, 'panda')
Ejemplo n.º 3
0
 def test_it_raises_when_user_cannot_be_found(self, celery):
     with pytest.raises(ValueError) as err:
         worker.rename_user(4, 'panda')
     assert err.value.message == 'Could not find user with id 4'