Skip to content

Commit

Permalink
add ctx processor test case
Browse files Browse the repository at this point in the history
  • Loading branch information
v.paritskiy authored and omab committed Dec 22, 2017
1 parent 5f231f1 commit ef3d82b
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/test_context_processors.py
@@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
from django.test import TestCase, RequestFactory, override_settings

from social_django.context_processors import login_redirect


@override_settings(REDIRECT_FIELD_NAME='next')
class TestContextProcessors(TestCase):
def setUp(self):
self.request_factory = RequestFactory()

def test_login_redirect_unicode_quote(self):
request = self.request_factory.get('/', data={'next': 'profile/sjó'})
result = login_redirect(request)
self.assertEqual(
result, {
'REDIRECT_FIELD_NAME': 'next',
'REDIRECT_FIELD_VALUE': 'profile/sj%C3%B3',
'REDIRECT_QUERYSTRING': 'next=profile/sj%C3%B3'
}
)

0 comments on commit ef3d82b

Please sign in to comment.