Esempio n. 1
0
    def test_question_with_dup_dimensions(self):
        """Questions can be linked to dimensions twice"""

        question = Question(source=self.article, text="This is a another question")
        question.save()
        question.add_dimension("hashtags")
        question.add_dimension("time")
        question.add_dimension("hashtags")
        question.save()

        dimensions = question.ordered_dimensions

        # retrieves the proper number of dimensions
        self.assertEquals(dimensions.count(), 3)

        # they are in the proper order
        keys = [d.key for d in dimensions]
        self.assertEquals(keys, ['hashtags', 'time', 'hashtags'])
Esempio n. 2
0
    def test_question_with_dup_dimensions(self):
        """Questions can be linked to dimensions twice"""

        question = Question(source=self.article,
                            text="This is a another question")
        question.save()
        question.add_dimension("hashtags")
        question.add_dimension("time")
        question.add_dimension("hashtags")
        question.save()

        dimensions = question.ordered_dimensions

        # retrieves the proper number of dimensions
        self.assertEquals(dimensions.count(), 3)

        # they are in the proper order
        keys = [d.key for d in dimensions]
        self.assertEquals(keys, ['hashtags', 'time', 'hashtags'])
Esempio n. 3
0
    def setUp(self):
        article = Article.objects.create(year=2014, authors="Lalal, Lala", link="http://doi.org/xDrz", title="this is a mock paper", venue="A mock conference")
        self.article = article

        question = Question(source=article, text="This is a question")
        question.save()
        question.add_dimension("hashtags")
        question.add_dimension("time")
        question.save()
        question = Question(source=article, text="This is another question")
        question.save()
        question.add_dimension("urls")
        question.add_dimension("language")
        question.save()
        question = Question(source=article, text="This is the 3rd question")
        question.save()
        question.add_dimension("sentiment")
        question.add_dimension("language")
        question.save()
Esempio n. 4
0
    def setUp(self):
        article = Article.objects.create(year=2014,
                                         authors="Lalal, Lala",
                                         link="http://doi.org/xDrz",
                                         title="this is a mock paper",
                                         venue="A mock conference")
        self.article = article

        question = Question(source=article, text="This is a question")
        question.save()
        question.add_dimension("hashtags")
        question.add_dimension("time")
        question.save()
        question = Question(source=article, text="This is another question")
        question.save()
        question.add_dimension("urls")
        question.add_dimension("language")
        question.save()
        question = Question(source=article, text="This is the 3rd question")
        question.save()
        question.add_dimension("sentiment")
        question.add_dimension("language")
        question.save()