i'm using django rest framework and mongo DB for app backend. I'm implementing a testsuite ex:
class RegisterViewSetTestCase(APITestCase):
def setUp(self):
def test1(self):
I'm runnig my test with the following command:
python ./manage.py test
SO test are working but an error is raise while deleting test database, this error:
Destroying test database for alias 'default'...
Traceback (most recent call last):
File "C:\Users\toto\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\djongo\sql2mongo\query.py", line 857, in parse
return handler(self, statement)
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\toto\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\djongo\sql2mongo\query.py", line 909, in _drop
self.cli_con.drop_database(db_name)
File "C:\Users\toto\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\pymongo\mongo_client.py", line 2093, in drop_database
self[name]._command(
File "C:\Users\toto\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\pymongo\database.py", line 641, in _command
return sock_info.command(
^^^^^^^^^^^^^^^^^^
File "C:\Users\toto\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\pymongo\pool.py", line 710, in command
return command(self, dbname, spec, secondary_ok,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\toto\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\pymongo\network.py", line 161, in command
helpers._check_command_response(
File "C:\Users\toto\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\pymongo\helpers.py", line 167, in _check_command_response
raise OperationFailure(errmsg, code, response, max_wire_version)
pymongo.errors.OperationFailure: user is not allowed to do action [dropDatabase] on [test_EamionTest.], full error: {'ok': 0, 'errmsg': 'user is not allowed to do action [dropDatabase] on [test_EamionTest.]', 'code': 8000, 'codeName': 'AtlasError'}
It's not critical because i can run my testsuite but an help might be usefull :)
I want to know what cause this error and how to fix it