MCPcopy Index your code
hub / github.com/fabioz/PyDev.Debugger / test_django_forms_resolver

Function test_django_forms_resolver

tests_python/test_resolvers.py:127–144  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

125
126
127def test_django_forms_resolver():
128 from _pydevd_bundle.pydevd_resolver import DjangoFormResolver
129
130 django_form_resolver = DjangoFormResolver()
131
132 class MyObject(object):
133 def __init__(self):
134 self.__dict__[(1, 2)] = (3, 4)
135 self.__dict__["errors"] = "foo"
136
137 obj = MyObject()
138
139 dictionary = clear_contents_dictionary(django_form_resolver.get_dictionary(obj))
140 assert dictionary == {"(1, 2)": (3, 4), "errors": None}
141
142 obj._errors = "bar"
143 dictionary = clear_contents_dictionary(django_form_resolver.get_dictionary(obj))
144 assert dictionary == {"(1, 2)": (3, 4), "errors": "bar", "_errors": "bar"}
145
146
147def clear_contents_debug_adapter_protocol(contents_debug_adapter_protocol):

Callers

nothing calls this directly

Calls 4

get_dictionaryMethod · 0.95
DjangoFormResolverClass · 0.90
MyObjectClass · 0.85

Tested by

no test coverage detected