File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 11import contextlib
2- from importlib import metadata
2+ import os
33
44from django .core .exceptions import ImproperlyConfigured
55from django .db .backends .base .base import BaseDatabaseWrapper
66from pymongo .collection import Collection
77from pymongo .driver_info import DriverInfo
88from pymongo .mongo_client import MongoClient
99
10+ from . import __version__ as django_mongodb_backend_version
1011from . import dbapi as Database
1112from .client import DatabaseClient
1213from .creation import DatabaseCreation
@@ -175,7 +176,9 @@ def get_new_connection(self, conn_params):
175176 return MongoClient (** conn_params , driver = self ._driver_info ())
176177
177178 def _driver_info (self ):
178- return DriverInfo ("django-mongodb" , metadata .version ("django-mongodb" ))
179+ if not os .environ .get ("RUNNING_DJANGOS_TEST_SUITE" ):
180+ return DriverInfo ("django-mongodb-backend" , django_mongodb_backend_version )
181+ return None
179182
180183 def _commit (self ):
181184 pass
You can’t perform that action at this time.
0 commit comments