def test_get_action_text_with_verb(self):
        """
        Tests get_action_text() with a verb, that the text output is correct.
        """
        self.action = Action.objects.create(actor=self.user, verb="joined the website")

        expected = "test_bob joined the website now"
        result = get_action_text(self.action)
        self.assertEqual(expected, result)
    def test_get_action_text_with_verb(self):
        """
        Tests get_action_text() with a verb, that the text output is correct.
        """
        self.action = Action.objects.create(
            actor=self.user,
            verb='joined the website'
        )

        expected = 'test_bob joined the website now'
        result = get_action_text(self.action)
        self.assertEqual(expected, result)
    def test_get_action_text_with_verb_action(self):
        """
        Tests get_action_text() with a verb and action, that the text output
        is correct.
        """
        self.action = Action.objects.create(
            actor=self.user, verb="made friends with", action=self.user2, timestamp=timezone.now() - timedelta(days=2)
        )

        expected = "test_bob made friends with test_gary 2 days ago"
        result = get_action_text(self.action)
        self.assertEqual(expected, result)
    def test_get_action_text_with_verb_action(self):
        """
        Tests get_action_text() with a verb and action, that the text output
        is correct.
        """
        self.action = Action.objects.create(
            actor=self.user,
            verb='made friends with',
            action=self.user2,
            timestamp=timezone.now() - timedelta(days=2)
        )

        expected = 'test_bob made friends with test_gary 2 days ago'
        result = get_action_text(self.action)
        self.assertEqual(expected, result)
    def test_get_action_text_with_verb_action_target(self):
        """
        Tests get_action_text() with a verb, action and target, that the text
        output is correct.
        """
        self.group = Group.objects.create(name="Some group")

        self.action = Action.objects.create(
            actor=self.user,
            verb="invited",
            action=self.user2,
            target=self.group,
            timestamp=timezone.now() - timedelta(days=2),
        )

        expected = "test_bob invited test_gary to Some group 2 days ago"
        result = get_action_text(self.action)
        self.assertEqual(expected, result)
    def test_get_action_text_with_verb_action_target(self):
        """
        Tests get_action_text() with a verb, action and target, that the text
        output is correct.
        """
        self.group = Group.objects.create(
            name='Some group'
        )

        self.action = Action.objects.create(
            actor=self.user,
            verb='invited',
            action=self.user2,
            target=self.group,
            timestamp=timezone.now() - timedelta(days=2)
        )

        expected = 'test_bob invited test_gary to Some group 2 days ago'
        result = get_action_text(self.action)
        self.assertEqual(expected, result)