Testcase and tentative fix for #1237

See discussion at https://github.com/tomchristie/django-rest-framework/issues/1237#issuecomment-37758323.