ran the tests and made some corrections to the merging

This commit is contained in:
Sébastien Piquemal 2012-01-03 11:10:14 +02:00
parent 59e6cd9892
commit 9dbe8b646e
3 changed files with 5 additions and 7 deletions

View File

@ -79,9 +79,9 @@ class BasicAuthentication(BaseAuthentication):
return None return None
try: try:
username = encoding.smart_unicode(auth_parts[0]) username = smart_unicode(auth_parts[0])
password = encoding.smart_unicode(auth_parts[2]) password = smart_unicode(auth_parts[2])
except encoding.DjangoUnicodeDecodeError: except DjangoUnicodeDecodeError:
return None return None
user = authenticate(username=username, password=password) user = authenticate(username=username, password=password)

View File

@ -126,8 +126,6 @@ class FormResource(Resource):
data = data and data or {} data = data and data or {}
files = files and files 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()) seen_fields_set = set(data.keys())
form_fields_set = set(bound_form.fields.keys()) form_fields_set = set(bound_form.fields.keys())
allowed_extra_fields_set = set(allowed_extra_fields) allowed_extra_fields_set = set(allowed_extra_fields)
@ -142,7 +140,7 @@ class FormResource(Resource):
cleaned_data = bound_form.cleaned_data cleaned_data = bound_form.cleaned_data
# Add in any extra fields to the cleaned content... # 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] cleaned_data[key] = data[key]
return cleaned_data return cleaned_data

View File

@ -157,7 +157,7 @@ class RendererIntegrationTests(TestCase):
_flat_repr = '{"foo": ["bar", "baz"]}' _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): class JSONRendererTests(TestCase):