Permalink
Browse files

Use a more specific name for search test

Searching for `addon` finds more than 30 results, but the API batches at 10
  • Loading branch information...
1 parent b6e0d53 commit 3f13a5aec047339538fddac0897debf1483e36c4 @hannosch hannosch committed Apr 6, 2013
Showing with 2 additions and 1 deletion.
  1. +2 −1 apps/search/tests/test_views.py
@@ -1077,7 +1077,8 @@ def test_ajax_search_webapp_by_id(self):
self.search_addons('q=%s' % addon.id, [])
def test_ajax_search_by_name(self):
- self.search_addons('q=add', list(Addon.objects.reviewed()))
+ addon = Addon.objects.filter(slug='addon-11')
@robhudson

robhudson Apr 6, 2013

Member

Don't these slug depend on the database ID, which may not always be the same? On jenkins they might be if the db is dropped between runs, but locally if you run these consecutively they may not be.

@hannosch

hannosch Apr 6, 2013

Owner

@robhudson Oh, haven't thought about that. Will fix tomorrow or Monday if you don't get there first ;)

+ self.search_addons('q=11', addon)
def test_ajax_search_by_bad_name(self):
self.search_addons('q=some+filthy+bad+word', [])

0 comments on commit 3f13a5a

Please sign in to comment.