diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2012-09-26 12:42:43 -0400 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2012-09-26 12:42:43 -0400 |
commit | 4c7c1fd28af8c02db4549c3b601727d3ccf8f798 (patch) | |
tree | 5b8598a3fb2488f6f2a459827c4e265f3fb64df1 /group_messaging/tests.py | |
parent | 3b0d0773664b8fa255e7b2ed3b468022e3455847 (diff) | |
parent | 74c55ff1382cc11eaa822bb0bf011ddd85797403 (diff) | |
download | askbot-4c7c1fd28af8c02db4549c3b601727d3ccf8f798.tar.gz askbot-4c7c1fd28af8c02db4549c3b601727d3ccf8f798.tar.bz2 askbot-4c7c1fd28af8c02db4549c3b601727d3ccf8f798.zip |
Merge branch 'group-messaging' into kp-dev
Diffstat (limited to 'group_messaging/tests.py')
-rw-r--r-- | group_messaging/tests.py | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/group_messaging/tests.py b/group_messaging/tests.py index 80f6f792..c8401dc1 100644 --- a/group_messaging/tests.py +++ b/group_messaging/tests.py @@ -51,11 +51,19 @@ class ModelTests(TestCase): #sender_group = get_personal_group(self.sender) #maybe add this too expected_recipients = set([recipient_group]) self.assertEqual(recipients, expected_recipients) - self.assertRaises( - MessageMemo.DoesNotExist, - MessageMemo.objects.get, - message=message - ) + #self.assertRaises( + # MessageMemo.DoesNotExist, + # MessageMemo.objects.get, + # message=message + #) + #make sure that the original senders memo to the root + #message is marke ad seen + memos = MessageMemo.objects.filter( + message=message, + user=self.sender + ) + self.assertEquals(memos.count(), 1) + self.assertEqual(memos[0].status, MessageMemo.SEEN) def test_get_senders_for_user(self): """this time send thread to a real group test that @@ -77,11 +85,13 @@ class ModelTests(TestCase): parent=root_message ) self.assertEqual(response.message_type, Message.STORED) + #assert that there is only one "seen" memo for the response memos = MessageMemo.objects.filter(message=response) self.assertEqual(memos.count(), 1) self.assertEqual(memos[0].user, self.recipient) self.assertEqual(memos[0].status, MessageMemo.SEEN) + #assert that recipients are the two people who are part of #this conversation recipients = set(response.recipients.all()) |