Skip to content

Commit

Permalink
Fix question view tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rehandalal committed Dec 18, 2013
1 parent da9ee82 commit 4f83b78
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions kitsune/questions/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -661,8 +661,8 @@ def _request(self, user=None, data=None):
def test_permissions(self):
"""Test that the new permission works"""
data = {
'product': self.p.id,
'topic': self.t.id,
'product': self.product.id,
'topic': self.topic.id,
'locale': self.question.locale
}

Expand All @@ -676,22 +676,22 @@ def test_permissions(self):
def test_missing_data(self):
"""Test for missing data"""
data = {
'product': self.p.id,
'product': self.product.id,
'locale': self.question.locale
}
response = self._request(data=data)
eq_(400, response.status_code)

data = {
'topic': self.t.id,
'topic': self.topic.id,
'locale': self.question.locale
}
response = self._request(data=data)
eq_(400, response.status_code)

data = {
'product': self.p.id,
'topic': self.t.id
'product': self.product.id,
'topic': self.topic.id
}
response = self._request(data=data)
eq_(400, response.status_code)
Expand All @@ -707,24 +707,24 @@ def test_bad_data(self):
eq_(400, response.status_code)

data = {
'product': self.p.id,
'topic': self.t.id,
'product': self.product.id,
'topic': self.topic.id,
'locale': 'zu'
}
response = self._request(data=data)
eq_(400, response.status_code)

def test_change_topic(self):
"""Test changing the topic"""
t_new = topic(product=self.p, save=True)
t_new = topic(product=self.product, save=True)

data = {
'product': self.p.id,
'product': self.product.id,
'topic': t_new.id,
'locale': self.question.locale
}

assert t_new.id != self.t.id
assert t_new.id != self.topic.id

response = self._request(data=data)
eq_(302, response.status_code)
Expand All @@ -739,8 +739,8 @@ def test_change_product(self):
t_new = topic(save=True)
p_new = t_new.product

assert self.t.id != t_new.id
assert self.p.id != p_new.id
assert self.topic.id != t_new.id
assert self.product.id != p_new.id

data = {
'product': p_new.id,
Expand All @@ -764,8 +764,8 @@ def test_change_locale(self):
assert locale != self.question.locale

data = {
'product': self.p.id,
'topic': self.t.id,
'product': self.product.id,
'topic': self.topic.id,
'locale': locale
}

Expand Down

0 comments on commit 4f83b78

Please sign in to comment.