Skip to content
Browse files

It helps when I test things.

  • Loading branch information...
1 parent ec5d0e4 commit 7dc6d0a465a7cbf773731c07f787ef172df9b1c3 @mythmon committed Jul 19, 2013
Showing with 11 additions and 3 deletions.
  1. +9 −0 kitsune/questions/tests/test_views.py
  2. +2 −3 kitsune/questions/views.py
View
9 kitsune/questions/tests/test_views.py
@@ -184,6 +184,15 @@ def test_ratelimit(self):
response = self.client.post(url, data, follow=True)
eq_(403, response.status_code)
+ def test_first_step(self):
+ """Make sure the first step doesn't blow up
+
+ Oddly, none of the other tests cover this simple case.
+ """
+ url = reverse('questions.aaq_step1')
+ res = self.client.get(url)
+ eq_(200, res.status_code)
+
class MobileAAQTests(MobileTestCase):
client_class = LocalizingClient
View
5 kitsune/questions/views.py
@@ -349,17 +349,16 @@ def aaq(request, product_key=None, category_key=None, showform=False,
product_key = 'firefox-os'
else:
product_key = 'mobile'
+
product = products.get(product_key)
if product_key and not product:
raise Http404
- product_obj = Product.objects.filter(
- slug__in=product.get('products'))
-
if category_key is None:
category_key = request.GET.get('category')
if product and category_key:
+ product_obj = Product.objects.filter(slug__in=product.get('products'))
category = product['categories'].get(category_key)
if not category:
# If we get an invalid category, redirect to previous step.

0 comments on commit 7dc6d0a

Please sign in to comment.
Something went wrong with that request. Please try again.