def test_reusable_deferred_award_visit(self):
        user1 = self._get_user(username="creator", email="creator@example.com")
        user2 = self._get_user(username="awardee1", email="a1@example.com")
        user3 = self._get_user(username="awardee2", email="a2@example.com")

        # Create the badge, a deferred award, and claim it once already.
        b1 = Badge.objects.create(creator=user1, title="Badge to defer")
        da = DeferredAward.objects.create(badge=b1, creator=user1,
                                          reusable=True)
        da.claim(user3)

        # Visiting the claim URL should yield the claim code page.
        url = da.get_claim_url()
        self.client.login(username="awardee1", password="trustno1")
        r = self.client.get(url, follow=True)
        eq_(200, r.status_code)
        doc = pq(r.content)
        form = doc('form#claim_award')
        eq_(1, form.length)
Issue #140: Viewing a claim page for a deferred award that has been
dataset/ETHPy150Open mozilla/django-badger/badger/tests/test_views.py/BadgerViewsTest.test_reusable_deferred_award_visit