Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(3)  |  Call(3)  |  Derive(0)  |  Import(0)

src/d/j/django-oscar-HEAD/tests/integration/catalogue/reviews/form_tests.py   django-oscar(Download)
    def test_allows_real_users_to_vote(self):
        form = forms.VoteForm(self.review, self.voter, data={'delta': 1})
        self.assertTrue(form.is_valid())
 
    def test_prevents_users_from_voting_more_than_once(self):
        self.review.vote_up(self.voter)
        form = forms.VoteForm(self.review, self.voter, data={'delta': 1})
    def test_prevents_users_voting_on_their_own_reviews(self):
        form = forms.VoteForm(self.review, self.reviewer, data={'delta': 1})
        self.assertFalse(form.is_valid())
        self.assertTrue(len(form.errors['__all__']) > 0)