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)
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)
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='******')
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)
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 )
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 )
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)
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)