Anonymous comment unit-test now tests against anonymous comments
This commit is contained in:
parent
220ceefbd2
commit
a825c6a4b9
1 changed files with 4 additions and 12 deletions
|
@ -1,4 +1,4 @@
|
||||||
import unittest
|
import sqlite3
|
||||||
|
|
||||||
from random import randint
|
from random import randint
|
||||||
import faker
|
import faker
|
||||||
|
@ -53,21 +53,13 @@ class TestDatabaseOperations(DatabaseTestCase):
|
||||||
self.assertEqual(reply['parent_id'], comment['comment_id'])
|
self.assertEqual(reply['parent_id'], comment['comment_id'])
|
||||||
|
|
||||||
def test02AnonymousComments(self):
|
def test02AnonymousComments(self):
|
||||||
comment = create_comment_or_error(
|
self.assertRaises(
|
||||||
|
sqlite3.IntegrityError,
|
||||||
|
create_comment_or_error,
|
||||||
conn=self.conn,
|
conn=self.conn,
|
||||||
claim_id=self.claimId,
|
claim_id=self.claimId,
|
||||||
comment='This is an ANONYMOUS comment'
|
comment='This is an ANONYMOUS comment'
|
||||||
)
|
)
|
||||||
self.assertIsNotNone(comment)
|
|
||||||
previous_id = comment['comment_id']
|
|
||||||
reply = create_comment_or_error(
|
|
||||||
conn=self.conn,
|
|
||||||
claim_id=self.claimId,
|
|
||||||
comment='This is an unnamed response',
|
|
||||||
parent_id=previous_id
|
|
||||||
)
|
|
||||||
self.assertIsNotNone(reply)
|
|
||||||
self.assertEqual(reply['parent_id'], comment['comment_id'])
|
|
||||||
|
|
||||||
def test03SignedComments(self):
|
def test03SignedComments(self):
|
||||||
comment = create_comment_or_error(
|
comment = create_comment_or_error(
|
||||||
|
|
Loading…
Reference in a new issue