Skip to content
This repository

bug 812728 - waffle new user filter #934

Merged
merged 1 commit into from over 1 year ago

2 participants

luke crouch James Socol
luke crouch
Owner

No description provided.

apps/dashboards/templates/dashboards/revisions.html
... ... @@ -31,8 +31,11 @@
31 31 <label for="revision-dashboard-user">{{ _('User') }}:</label>
32 32 <input name="user" id="revision-dashboard-user" value="{{ request.GET.user }}" />
33 33
  34 + {% if waffle.flag('revision-dashboard-newusers') %}
34 35 <label for="revision-dashboard-newusers">{{ _('New users only')}}</label>
1
James Socol
jsocol added a note

I'd indent these two lines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
James Socol

r=me with comment assuming tests pass.

luke crouch groovecoder merged commit e41f3e8 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Mar 19, 2013
luke crouch groovecoder bug 812728 - waffle new user filter 2c279f8
This page is out of date. Refresh to see the latest.
7 apps/dashboards/templates/dashboards/revisions.html
@@ -31,8 +31,11 @@
31 31 <label for="revision-dashboard-user">{{ _('User') }}:</label>
32 32 <input name="user" id="revision-dashboard-user" value="{{ request.GET.user }}" />
33 33
34   - <label for="revision-dashboard-newusers">{{ _('New users only')}}</label>
35   - <input type="checkbox" name="newusers" id="revision-dashboard-newusers" {% if request.GET.newusers %}checked{% endif %} />
  34 + {% if waffle.flag('revision-dashboard-newusers') %}
  35 + <label for="revision-dashboard-newusers">{{ _('New users only')}}</label>
  36 + <input type="checkbox" name="newusers" id="revision-dashboard-newusers" {% if request.GET.newusers %}checked{% endif %} />
  37 + {% endif %}
  38 +
36 39
37 40 <label for="revision-dashboard-topic">{{ _('Topic') }}:</label>
38 41 <input name="topic" id="revision-dashboard-topic" value="{{ request.GET.topic }}" />
19 apps/dashboards/tests/test_views.py
@@ -2,6 +2,7 @@
2 2
3 3 from nose.plugins.attrib import attr
4 4 from nose.tools import eq_, ok_
  5 +from pyquery import PyQuery as pq
5 6
6 7 from waffle.models import Flag
7 8
@@ -97,4 +98,20 @@ def test_topic_filter(self):
97 98 response = self.client.get(url, HTTP_X_REQUESTED_WITH='XMLHttpRequest')
98 99 eq_(200, response.status_code)
99 100 revisions = json.loads(response.content)
100   - ok_(['lorem' not in rev['slug'] for rev in revisions['aaData']])
  101 + ok_(['lorem' not in rev['slug'] for rev in revisions['aaData']])
  102 +
  103 + @attr('dashboards')
  104 + def test_newuser_filter_waffle(self):
  105 + url = reverse('dashboards.revisions', locale='en-US')
  106 + response = self.client.get(url)
  107 + eq_(200, response.status_code)
  108 + ok_('revision-dashboard-newusers' not in response.content)
  109 +
  110 + rev_dash_newusers = Flag.objects.create(
  111 + name='revision-dashboard-newusers', everyone=True)
  112 + rev_dash_newusers.save()
  113 +
  114 + url = reverse('dashboards.revisions', locale='en-US')
  115 + response = self.client.get(url)
  116 + eq_(200, response.status_code)
  117 + ok_('revision-dashboard-newusers' in response.content)

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.