Commit 3fdbbf55 authored by okhin's avatar okhin 🚴

Fix the data given to a test

parent e0173e2f
......@@ -201,10 +201,11 @@ class TestArticleViews(TestCase):
codename='can_edit'))
self.client.force_login(user=self.user)
a = json.loads(serializers.serialize('json', [self.articles[0]]))[0]
a['fields']['title'] = 'Zog Zog'
r = self.client.post('/rp/article/edit/{}/'.format(a['pk']), a['fields'])
a = Article.objects.get(pk=a['pk'])
pk = self.articles[0].pk
fields = {'title': 'Zog Zog'}
r = self.client.post('/rp/article/edit/{}/'.format(pk), fields)
a = Article.objects.get(pk=pk)
assert r.status_code == 302 # We're redirecting after edit
assert a.title == 'Zog Zog'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment