Show More
@@ -14,8 +14,6 b' class ApiTest(TestCase):' | |||||
14 | opening_post = Post.objects.create_post(title='title', text='text', |
|
14 | opening_post = Post.objects.create_post(title='title', text='text', | |
15 | tags=[tag]) |
|
15 | tags=[tag]) | |
16 |
|
16 | |||
17 | last_edit_time = str(opening_post.last_edit_time) |
|
|||
18 |
|
||||
19 | req = MockRequest() |
|
17 | req = MockRequest() | |
20 | req.GET['thread'] = opening_post.id |
|
18 | req.GET['thread'] = opening_post.id | |
21 | req.POST['uids'] = opening_post.uid |
|
19 | req.POST['uids'] = opening_post.uid | |
@@ -30,8 +28,6 b' class ApiTest(TestCase):' | |||||
30 | reply = Post.objects.create_post(title='', |
|
28 | reply = Post.objects.create_post(title='', | |
31 | text='[post]%d[/post]\ntext' % opening_post.id, |
|
29 | text='[post]%d[/post]\ntext' % opening_post.id, | |
32 | thread=opening_post.get_thread()) |
|
30 | thread=opening_post.get_thread()) | |
33 | uids += [reply.uid] |
|
|||
34 |
|
||||
35 | req = MockRequest() |
|
31 | req = MockRequest() | |
36 | req.GET['thread'] = opening_post.id |
|
32 | req.GET['thread'] = opening_post.id | |
37 | req.POST['uids'] = ' '.join(uids) |
|
33 | req.POST['uids'] = ' '.join(uids) | |
@@ -41,9 +37,11 b' class ApiTest(TestCase):' | |||||
41 | self.assertEqual(2, len(diff['updated']), |
|
37 | self.assertEqual(2, len(diff['updated']), | |
42 | 'There must be 2 updated posts in the diff.') |
|
38 | 'There must be 2 updated posts in the diff.') | |
43 |
|
39 | |||
|
40 | # Reload post to get the new UID | |||
|
41 | opening_post = Post.objects.get(id=opening_post.id) | |||
44 | req = MockRequest() |
|
42 | req = MockRequest() | |
45 | req.GET['thread'] = opening_post.id |
|
43 | req.GET['thread'] = opening_post.id | |
46 |
req. |
|
44 | req.POST['uids'] = ' '.join([opening_post.uid, reply.uid]) | |
47 | empty_response = api.api_get_threaddiff(req) |
|
45 | empty_response = api.api_get_threaddiff(req) | |
48 | diff = simplejson.loads(empty_response.content) |
|
46 | diff = simplejson.loads(empty_response.content) | |
49 | self.assertEqual(0, len(diff['updated']), |
|
47 | self.assertEqual(0, len(diff['updated']), |
General Comments 0
You need to be logged in to leave comments.
Login now