tomchristie/django-rest-framework — pull request #1455 by ericbuehl (2014-03-05 18:00:52+00:00)
Title: don't implicitly import provider.oauth2

The django-oauth2-provider package is extensible to support multiple backend implementations in addition or substitution to the included default, provider.oauth2. However, by implicitly importing provider.oauth2 through the rest_framework.compat, django automatically links up model relations from provider.oauth2 to auth.user. If a different backend is in use besides the default provider.oauth2, this is undesirable and causes errors when iterating through model relations if the provider.oauth2 database tables do not exist.

This patch prevents global importing of the provider.oauth2 module but it still relies on it for test cases; all of which still pass.