'Setting `force_authenticate()` forcibly authenticates the request.'

def test_force_authenticate(self):

    user = User.objects.create_user(u'example', u'example@example.com')
    factory = APIRequestFactory()
    request = factory.get(u'/view')
    force_authenticate(request, user=user)
    response = view(request)
    assert (response.data[u'user'] == u'example')
