I have both model and social backends configured in settings.py:

> AUTHENTICATION_BACKENDS = (
>     'django.contrib.auth.backends.ModelBackend',
>     'social_core.backends.mediawiki.MediaWiki',
> )


When I run this test:

> from django.test import TestCase, Client
> from django.contrib.auth.models import User
> 
> 
> class UserActivitiesViewTest(TestCase):
>     def test_mainspace_title_contains_colon(self):
>         user_fred = User.objects.create_user('Fred', 'f...@example.com', 
> 'password')
>         client = Client()
>         client.force_login(user_fred, 
> backend='django.contrib.auth.backends.ModelBackend')
>         response = client.get('/spi/spi-user-activities/Foo', {'count': 10, 
> 'main': 1}, follow=True)


The view that's being tested is:

> class UserActivitiesView(LoginRequiredMixin, View):
>     def get(self, request, user_name):
>       .....


I get a social_django.models.UserSocialAuth.DoesNotExist exception in the 
client.get() call.  Why is it doing any kind of query on UserSocialAuth if I'm 
telling force_login() to use ModelBackend?

I'm running django 2.2, python 3.7

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/F63F152D-91BE-41DA-A13D-F54D1D708AD8%40panix.com.

Reply via email to