|
|
|
@ -84,7 +84,9 @@ class TestComments(unittest.TestCase):
|
|
|
|
|
def testDelete(self):
|
|
|
|
|
|
|
|
|
|
self.post('/comment/path/new', data=json.dumps(comment(text='Lorem ipsum ...')))
|
|
|
|
|
assert self.delete('/comment/path/1').status_code == 200
|
|
|
|
|
r = self.delete('/comment/path/1')
|
|
|
|
|
assert r.status_code == 200
|
|
|
|
|
assert json.loads(r.data) == None
|
|
|
|
|
assert self.get('/comment/path/1').status_code == 404
|
|
|
|
|
|
|
|
|
|
def testDeleteWithReference(self):
|
|
|
|
@ -92,6 +94,9 @@ class TestComments(unittest.TestCase):
|
|
|
|
|
self.post('/comment/path/new', data=json.dumps(comment(text='First')))
|
|
|
|
|
self.post('/comment/path/new', data=json.dumps(comment(text='Second', parent=1)))
|
|
|
|
|
|
|
|
|
|
r = self.delete('/comment/path/2')
|
|
|
|
|
r = self.delete('/comment/path/1')
|
|
|
|
|
assert r.status_code == 200
|
|
|
|
|
assert Comment(**json.loads(r.data)).deleted
|
|
|
|
|
|
|
|
|
|
assert self.get('/comment/path/1').status_code == 200
|
|
|
|
|
assert self.get('/comment/path/2').status_code == 200
|
|
|
|
|