mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-28 04:24:00 +03:00
ran the tests and made some corrections to the merging
This commit is contained in:
parent
59e6cd9892
commit
9dbe8b646e
|
@ -79,9 +79,9 @@ class BasicAuthentication(BaseAuthentication):
|
|||
return None
|
||||
|
||||
try:
|
||||
username = encoding.smart_unicode(auth_parts[0])
|
||||
password = encoding.smart_unicode(auth_parts[2])
|
||||
except encoding.DjangoUnicodeDecodeError:
|
||||
username = smart_unicode(auth_parts[0])
|
||||
password = smart_unicode(auth_parts[2])
|
||||
except DjangoUnicodeDecodeError:
|
||||
return None
|
||||
|
||||
user = authenticate(username=username, password=password)
|
||||
|
|
|
@ -126,8 +126,6 @@ class FormResource(Resource):
|
|||
data = data and data or {}
|
||||
files = files and files or {}
|
||||
|
||||
# In addition to regular validation we also ensure no additional fields
|
||||
# are being passed in...
|
||||
seen_fields_set = set(data.keys())
|
||||
form_fields_set = set(bound_form.fields.keys())
|
||||
allowed_extra_fields_set = set(allowed_extra_fields)
|
||||
|
@ -142,7 +140,7 @@ class FormResource(Resource):
|
|||
cleaned_data = bound_form.cleaned_data
|
||||
|
||||
# Add in any extra fields to the cleaned content...
|
||||
for key in (allowed_extra_fields & seen_fields) - set(cleaned_data.keys()):
|
||||
for key in (allowed_extra_fields_set & seen_fields_set) - set(cleaned_data.keys()):
|
||||
cleaned_data[key] = data[key]
|
||||
|
||||
return cleaned_data
|
||||
|
|
|
@ -157,7 +157,7 @@ class RendererIntegrationTests(TestCase):
|
|||
|
||||
_flat_repr = '{"foo": ["bar", "baz"]}'
|
||||
|
||||
_indented_repr = '{\n "foo": [\n "bar", \n "baz"\n ]\n}'
|
||||
_indented_repr = '{\n "foo": [\n "bar",\n "baz"\n ]\n}'
|
||||
|
||||
|
||||
class JSONRendererTests(TestCase):
|
||||
|
|
Loading…
Reference in New Issue
Block a user