Beispiel #1
0
    def test_user_mentions_for_contacts_comments(self):
        self.user_comment = User.objects.create(
            first_name="johnComment", username='******', email='*****@*****.**', role='ADMIN')
        self.user_comment.set_password('password')
        self.user_comment.save()

        self.comment.comment = 'content @{}'.format(self.user_comment.username)
        self.comment.contact = self.contact
        self.comment.save()

        task = send_email_user_mentions.apply((
            self.comment.id, 'contacts',),)
        self.assertEqual('SUCCESS', task.state)
Beispiel #2
0
    def test_user_mentions_for_account_comment(self):
        self.user_comment = User.objects.create(
            first_name="johnComment",
            username="******",
            email="*****@*****.**",
            role="ADMIN",
        )
        self.user_comment.set_password("password")
        self.user_comment.save()

        self.comment.comment = "content @{}".format(self.user_comment.username)
        self.comment.account = self.account
        self.comment.save()

        task = send_email_user_mentions.apply((
            self.comment.id,
            "accounts",
        ), )
        self.assertEqual("SUCCESS", task.state)
    def test_user_mentions_for_events_comments(self):
        self.company, _ = Company.objects.get_or_create(name="test company",
                                                        address="IN",
                                                        sub_domain="test",
                                                        country="IN")
        self.user_comment = User.objects.create(
            first_name="johnComment",
            username="******",
            email="*****@*****.**",
            role="ADMIN",
            company=self.company,
        )
        self.user_comment.set_password("password")
        self.user_comment.save()

        self.comment.comment = "content @{}".format(self.user_comment.username)
        self.comment.event = self.event
        self.comment.save()

        task = send_email_user_mentions.apply((
            self.comment.id,
            "events",
        ), )
        self.assertEqual("SUCCESS", task.state)