MCPcopy
hub / github.com/django/django / _validate_databases

Method _validate_databases

django/test/testcases.py:224–242  ·  view source on GitHub ↗
(cls)

Source from the content-addressed store, hash-verified

222
223 @classmethod
224 def _validate_databases(cls):
225 if cls.databases == "__all__":
226 return frozenset(connections)
227 for alias in cls.databases:
228 if alias not in connections:
229 message = (
230 "%s.%s.databases refers to %r which is not defined in "
231 "settings.DATABASES."
232 % (
233 cls.__module__,
234 cls.__qualname__,
235 alias,
236 )
237 )
238 close_matches = get_close_matches(alias, list(connections))
239 if close_matches:
240 message += " Did you mean %r?" % close_matches[0]
241 raise ImproperlyConfigured(message)
242 return frozenset(cls.databases)
243
244 @classmethod
245 def _add_databases_failures(cls):

Callers 5

test_no_close_matchMethod · 0.80
test_close_matchMethod · 0.80
test_matchMethod · 0.80
test_allMethod · 0.80

Calls 1

Tested by

no test coverage detected