Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add test for flag.languages.

  • Loading branch information...
commit 5d427a6ae9fa13bdf8c285f6ff1cbc6cf292cd9f 1 parent 9626da3
James Socol authored
Showing with 14 additions and 0 deletions.
  1. +14 −0 waffle/tests/test_waffle.py
14 waffle/tests/test_waffle.py
View
@@ -95,6 +95,20 @@ def test_staff(self):
eq_('off', response.content)
assert not 'dwf_myflag' in response.cookies
+ def test_languages(self):
+ Flag.objects.create(name='myflag', languages='en,fr')
+ request = get()
+ response = process_request(request, views.flag_in_view)
+ eq_('off', response.content)
+
+ request.LANGUAGE_CODE = 'en'
+ response = process_request(request, views.flag_in_view)
+ eq_('on', response.content)
+
+ request.LANGUAGE_CODE = 'de'
+ response = process_request(request, views.flag_in_view)
+ eq_('off', response.content)
+
def test_user(self):
"""Test the per-user switch."""
user = User.objects.create(username='foo')
Please sign in to comment.
Something went wrong with that request. Please try again.