MCPcopy
hub / github.com/django/django / get_storage

Method get_storage

tests/messages_tests/base.py:67–78  ·  view source on GitHub ↗

Return the storage backend, setting its loaded data to the ``data`` argument. This method avoids the storage ``_get`` method from getting called so that other parts of the storage backend can be tested independent of the message retrieval logic.

(self, data=None)

Source from the content-addressed store, hash-verified

65 return HttpResponse()
66
67 def get_storage(self, data=None):
68 """
69 Return the storage backend, setting its loaded data to the ``data``
70 argument.
71
72 This method avoids the storage ``_get`` method from getting called so
73 that other parts of the storage backend can be tested independent of
74 the message retrieval logic.
75 """
76 storage = self.storage_class(self.get_request())
77 storage._loaded_data = data or []
78 return storage
79
80 def test_repr(self):
81 request = self.get_request()

Callers 15

test_addMethod · 0.95
test_no_updateMethod · 0.95
test_add_updateMethod · 0.95
get_existing_storageMethod · 0.95
test_default_levelMethod · 0.95
test_tagsMethod · 0.95
test_level_tagMethod · 0.95
test_custom_tagsMethod · 0.95
test_safedataMethod · 0.45
encode_decodeMethod · 0.45
test_cookie_settingsMethod · 0.45

Calls 1

get_requestMethod · 0.95

Tested by 15

test_addMethod · 0.76
test_no_updateMethod · 0.76
test_add_updateMethod · 0.76
test_default_levelMethod · 0.76
test_tagsMethod · 0.76
test_level_tagMethod · 0.76
test_custom_tagsMethod · 0.76
test_safedataMethod · 0.36
encode_decodeMethod · 0.36
test_cookie_settingsMethod · 0.36