예제 #1
0
    def should_create_an_opinion_with_the_given_target (self):
        voice = Voice(self.me)
        voice.express_opinion_about(self.legfile, statement='blah1', position='support')

        opinion = Opinion.objects.all()[0]
        assert_equal(opinion.opiner, self.me)
        assert_equal(opinion.target, self.legfile)
        assert_equal(opinion.latest.statement, 'blah1')
        assert_equal(opinion.latest.position, 'support')
예제 #2
0
    def sets_up_deferred_saving_if_commit_is_False (self):
        voice = Voice(self.me)
        opinion = voice.express_opinion_about(self.legfile, statement='blah1', position='support', commit=False)

        assert_is_none(opinion.pk)
        assert hasattr(voice, 'save_revision')