Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge remote-tracking branch 'origin/follow-anything-tests'

  • Loading branch information...
commit 907a6b6df11617ed61932b5ca92632374f7210d3 2 parents b0b6382 + e1d70d0
Chris Beaven authored April 12, 2012

Showing 1 changed file with 11 additions and 3 deletions. Show diff stats Hide diff stats

  1. 14  actstream/tests.py
14  actstream/tests.py
@@ -39,6 +39,7 @@ class ActivityTestCase(ActivityBaseTestCase):
39 39
     def setUp(self):
40 40
         super(ActivityTestCase, self).setUp()
41 41
         self.group = Group.objects.create(name='CoolGroup')
  42
+        self.group2 = Group.objects.create(name='Nerds')
42 43
         self.user1 = User.objects.get_or_create(username='admin')[0]
43 44
         self.user1.set_password('admin')
44 45
         self.user1.is_superuser = self.user1.is_staff = True
@@ -59,6 +60,9 @@ def setUp(self):
59 60
         # User2 follows group
60 61
         follow(self.user2, self.group)
61 62
 
  63
+        # User2 follows the second group (not just as an actor).
  64
+        follow(self.user2, self.group2, actor_only=False)
  65
+
62 66
         # User1 comments on group
63 67
         # Use a site object here and predict the "__unicode__ method output"
64 68
         action.send(self.user1, verb='commented on', target=self.group)
@@ -77,6 +81,7 @@ def test_aauser1(self):
77 81
 
78 82
     def test_user2(self):
79 83
         self.assertEqual(map(unicode, Action.objects.actor(self.user2)), [
  84
+            u'Two started following Nerds 0 minutes ago',
80 85
             u'Two started following CoolGroup 0 minutes ago',
81 86
             u'Two joined CoolGroup 0 minutes ago',
82 87
         ])
@@ -91,11 +96,14 @@ def test_empty_follow_stream(self):
91 96
 
92 97
     def test_stream(self):
93 98
         self.assertEqual(map(unicode, Action.objects.user(self.user1)), [
  99
+            u'Two started following Nerds 0 minutes ago',
94 100
             u'Two started following CoolGroup 0 minutes ago',
95 101
             u'Two joined CoolGroup 0 minutes ago',
96 102
         ])
97  
-        self.assertEqual(map(unicode, Action.objects.user(self.user2)),
98  
-            [u'CoolGroup responded to admin: Sweet Group!... 0 minutes ago'])
  103
+        self.assertEqual(map(unicode, Action.objects.user(self.user2)), [
  104
+            u'CoolGroup responded to admin: Sweet Group!... 0 minutes ago',
  105
+            u'Two started following Nerds 0 minutes ago',
  106
+        ])
99 107
 
100 108
     def test_stream_stale_follows(self):
101 109
         """
@@ -158,7 +166,7 @@ def test_zzzz_no_orphaned_actions(self):
158 166
         self.assertEqual(actions, self.user1.actor_actions.count() + 1)
159 167
 
160 168
     def test_generic_relation_accessors(self):
161  
-        self.assertEqual(self.user2.actor_actions.count(), 2)
  169
+        self.assertEqual(self.user2.actor_actions.count(), 3)
162 170
         self.assertEqual(self.user2.target_actions.count(), 1)
163 171
         self.assertEqual(self.user2.action_object_actions.count(), 0)
164 172
 

0 notes on commit 907a6b6

Please sign in to comment.
Something went wrong with that request. Please try again.