Exemplo n.º 1
0
 def test_quality_has_untreated_discussions(self):
     user = UserFactory()
     visitor = UserFactory()
     dataset = DatasetFactory(description='', owner=user)
     messages = MessageDiscussionFactory.build_batch(2, posted_by=visitor)
     DiscussionFactory(subject=dataset, user=visitor, discussion=messages)
     self.assertEqual(dataset.quality['discussions'], 1)
     self.assertTrue(dataset.quality['has_untreated_discussions'])
     self.assertEqual(dataset.quality['score'], 0)
Exemplo n.º 2
0
 def test_quality_has_untreated_discussions(self):
     user = UserFactory()
     visitor = UserFactory()
     dataset = DatasetFactory(description='', owner=user)
     messages = MessageDiscussionFactory.build_batch(2, posted_by=visitor)
     DiscussionFactory(subject=dataset, user=visitor, discussion=messages)
     assert dataset.quality['discussions'] == 1
     assert dataset.quality['has_untreated_discussions']
     assert dataset.quality['score'] == 0
Exemplo n.º 3
0
 def test_quality_has_treated_discussions(self):
     user = UserFactory()
     visitor = UserFactory()
     dataset = DatasetFactory(description='', owner=user)
     DiscussionFactory(
         subject=dataset,
         user=visitor,
         discussion=[MessageDiscussionFactory(posted_by=user)] +
         MessageDiscussionFactory.build_batch(2, posted_by=visitor))
     assert dataset.quality['discussions'] == 1
     assert not dataset.quality['has_untreated_discussions']
     assert dataset.quality['score'] == 2