def test_non_superuser_needs_correct_permissions_to_moderate(self):
        Message.objects.update(status='pending')

        newuser = mommy.make(get_user_model())
        newuser.add_to_group(self.group2.pk)
        self.group2.owners.add(newuser)

        self.assertIn(self.message3.thread.group, newuser.groups_moderating)
        self.assertNotIn(self.message1.thread.group, newuser.groups_moderating)

        changes = {
            'spam': [self.message1.pk],
            'approved': [self.message3.pk]
        }
        total = moderate_messages(changes, newuser)

        self.assertTrue(
            self.message3.messagemoderationaction_set.filter(
                newstatus='approved').exists()
        )
        self.assertEqual(total, 1)

        # We need to grab message1 from the database again to confirm it has
        # not changed
        message1 = Message.objects.get(pk=self.message1.pk)
        self.assertEqual(message1.status, 'pending')
Set the wallclock time for this status message.
dataset/ETHPy150Open ofa/connect/open_connect/moderation/tests/test_utils.py/TestModerationAction.test_non_superuser_needs_correct_permissions_to_moderate--crossover with--dataset/ETHPy150Open livid/v2ex/twitter/twitter.py/Status.SetNow