Skip to content
This repository has been archived by the owner on Feb 1, 2018. It is now read-only.

Commit

Permalink
Fixes bug 847294 - Force running query when do_query is set in the URL.
Browse files Browse the repository at this point in the history
  • Loading branch information
adngdb committed Mar 4, 2013
1 parent e1a5833 commit 2114499
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
12 changes: 11 additions & 1 deletion crashstats/crashstats/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1284,7 +1284,7 @@ def mocked_get(url, **options):
eq_(response.status_code, 200)
ok_('<h2>Query Results</h2>' not in response.content)
ok_('table id="signatureList"' not in response.content)
# Because verions in the search form only gets set on DOM ready,
# Because versions in the search form only gets set on DOM ready,
# we here ensure that the version was passed and set by checking
# that the correct version is selected in the versions drop-down.
ok_('option value="18.0" selected' in response.content)
Expand Down Expand Up @@ -1354,6 +1354,16 @@ def mocked_get(url, **options):
in response.content)
ok_('value="days" selected' in response.content)

# Test that do_query forces the query
response = self.client.get(url, {
'do_query': 1,
'product': 'Firefox'
})
eq_(response.status_code, 200)
ok_('<h2>Query Results</h2>' in response.content)
ok_('table id="signatureList"' in response.content)
ok_('nsASDOMWindowEnumerator::GetNext()' in response.content)

@mock.patch('requests.post')
@mock.patch('requests.get')
def test_query_summary(self, rget, rpost):
Expand Down
1 change: 1 addition & 0 deletions crashstats/crashstats/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1290,6 +1290,7 @@ def query(request):
}

if (
request.GET.get('do_query') or
request.GET.get('date') or
request.GET.get('query')
):
Expand Down

0 comments on commit 2114499

Please sign in to comment.