コード例 #1
0
 def test_current_count(self):
     response = ResponseFactory(author=self.user)
     ModerationFactory.create_batch(
         response=response, positive_in_tone=True, size=11
     )
     ModerationFactory.create_batch(
         response=response, positive_in_tone=False, size=5
     )
     self.assertEquals(self.user.profile.profile_stats["current_count"], 16)
コード例 #2
0
 def test_personal_change(self):
     response = ResponseFactory(author=self.user)
     ModerationFactory.create_batch(
         response=response,
         personal=True,
         size=10,
         submitted_at=now() - timedelta(days=10),
     )
     ModerationFactory.create_batch(response=response, personal=True, size=5)
     ModerationFactory.create_batch(response=response, personal=False, size=5)
     self.assertEquals(self.user.profile.profile_stats["personal_change"], -0.5)
コード例 #3
0
ファイル: test_user_api.py プロジェクト: johngian/m-response
    def setUp(self):
        self.user = UserFactory()
        self.user.set_password('password')
        self.user.save()

        response = ResponseFactory(author=self.user)
        ModerationFactory.create_batch(response=response,
                                       positive_in_tone=True,
                                       size=11)

        # Login
        self.client.login(username=self.user.username, password='******')
コード例 #4
0
 def test_previous_count(self):
     response = ResponseFactory(author=self.user)
     ModerationFactory.create_batch(
         response=response,
         positive_in_tone=True,
         size=11,
         submitted_at=now() - timedelta(days=10),
     )
     ModerationFactory.create_batch(
         response=response,
         positive_in_tone=False,
         size=5,
         submitted_at=now() - timedelta(days=11),
     )
     self.assertEquals(self.user.profile.profile_stats["previous_count"], 16)
コード例 #5
0
    def test_addressing_the_issue_change(self):
        response = ResponseFactory(author=self.user)
        ModerationFactory.create_batch(
            response=response, addressing_the_issue=True, size=11
        )
        ModerationFactory.create_batch(
            response=response, addressing_the_issue=False, size=5
        )

        ModerationFactory.create_batch(
            response=response,
            addressing_the_issue=True,
            size=10,
            submitted_at=now() - timedelta(days=10),
        )
        self.assertEquals(
            self.user.profile.profile_stats["addressing_the_issue_change"], 0.1
        )
コード例 #6
0
 def test_addressing_the_issue_count(self):
     response = ResponseFactory(author=self.user)
     ModerationFactory(response=response, addressing_the_issue=True)
     self.assertEquals(
         self.user.profile.profile_stats["addressing_the_issue_count"], 1
     )
コード例 #7
0
 def test_positive_in_tone_count(self):
     response = ResponseFactory(author=self.user)
     ModerationFactory(response=response, positive_in_tone=True)
     self.assertEquals(self.user.profile.profile_stats["positive_in_tone_count"], 1)
コード例 #8
0
 def test_personal_count(self):
     response = ResponseFactory(author=self.user)
     ModerationFactory(response=response, personal=True)
     self.assertEquals(self.user.profile.profile_stats["personal_count"], 1)