Beispiel #1
0
    def test_after_removing_a_editor_from_a_map_a_editor_removed_action_is_triggered(self):
        a_user = UserFactory.create()
        a_map = MapFactory.create(creator=a_user)
        another_user = UserFactory.create()
        a_map.editors.add(another_user)
        a_map.editors.remove(another_user)

        am = ActivityManager()
        removed_from_editors = am.removed_from_editors(a_user)

        self.assertTrue(len(removed_from_editors))
        action = removed_from_editors[0]

        self.assertEqual(action.actor, a_user)
        self.assertEqual(action.action_object, another_user)
        self.assertEqual(action.target, a_map)
        self.assertEqual(action.verb, REMOVED_FROM_EDITORS)