コード例 #1
0
 def test_make_unique_slug(self):
     """
     Ensure that unique slugs are generated even from titles whose
     first 50 characters are identical.
     
     """
     s = save_valid_submission("This is a really long title whose only purpose in life is to be longer than fifty characters")
     s2 = save_valid_submission("This is a really long title whose only purpose in life is to be longer than fifty characters and not the same as the first title")
     s3 = save_valid_submission("This is a really long title whose only purpose in life is to be longer than fifty characters and not the same as the first or second title")
     ok_(s.slug != s2.slug and s.slug != s3.slug and s2.slug != s3.slug)
コード例 #2
0
ファイル: test_views.py プロジェクト: craigcook/kuma
 def test_derby_after_deadline(self):
     s = save_valid_submission("hello world")
     closed_dt = datetime.date.today() - datetime.timedelta(days=32)
     s.taggit_tags.set_ns("challenge:", closed_dt.strftime("%Y:%B").lower())
     form = SubmissionEditForm(instance=s)
     assert "demo_package" not in form.fields
     assert "challenge_tags" not in form.fields
コード例 #3
0
    def test_edit_valid(self):
        s = save_valid_submission()
        edit_url = reverse('demos_edit', args=[s.slug])
        r = self.client.post(edit_url,
                             data=dict(
                                 title=s.title,
                                 summary='This is a test demo submission',
                                 description='Some description goes here',
                                 tech_tags=(
                                     'tech:audio',
                                     'tech:video',
                                     'tech:websockets',
                                 ),
                                 license_name='gpl',
                                 accept_terms='1',
                             ))

        eq_(302, r.status_code)
        assert 'Location' in r
        assert 'hello-world' in r['Location']

        try:
            obj = Submission.objects.get(slug='hello-world')
            eq_('This is a test demo submission', obj.summary)
        except Submission.DoesNotExist:
            assert False
コード例 #4
0
ファイル: test_views.py プロジェクト: trinaldi/kuma
 def test_derby_after_deadline(self):
     s = save_valid_submission('hello world')
     closed_dt = datetime.date.today() - datetime.timedelta(days=32)
     s.taggit_tags.set_ns('challenge:', closed_dt.strftime('%Y:%B').lower())
     form = SubmissionEditForm(instance=s)
     assert 'demo_package' not in form.fields
     assert 'challenge_tags' not in form.fields
コード例 #5
0
 def test_derby_after_deadline(self):
     s = save_valid_submission('hello world')
     closed_dt = datetime.date.today() - datetime.timedelta(days=32)
     s.taggit_tags.set_ns('challenge:', closed_dt.strftime('%Y:%B').lower())
     form = SubmissionEditForm(instance=s)
     assert 'demo_package' not in form.fields
     assert 'challenge_tags' not in form.fields
コード例 #6
0
ファイル: test_views.py プロジェクト: craigcook/kuma
 def test_challenge_closed_model(self):
     s = save_valid_submission("hellow world")
     assert not s.challenge_closed()
     s.taggit_tags.set_ns("challenge:", make_challenge_tag())
     assert not s.challenge_closed()
     closed_dt = datetime.date.today() - datetime.timedelta(days=32)
     s.taggit_tags.set_ns("challenge:", closed_dt.strftime("%Y:%B").lower())
     assert s.challenge_closed()
コード例 #7
0
 def test_challenge_closed_model(self):
     s = save_valid_submission('hellow world')
     assert not s.challenge_closed()
     s.taggit_tags.set_ns('challenge:', make_challenge_tag())
     assert not s.challenge_closed()
     closed_dt = datetime.date.today() - datetime.timedelta(days=32)
     s.taggit_tags.set_ns('challenge:', closed_dt.strftime('%Y:%B').lower())
     assert s.challenge_closed()
コード例 #8
0
ファイル: test_views.py プロジェクト: tantek/kuma
    def test_detail(self):
        s = save_valid_submission('hello world')

        url = reverse('demos_detail', args=[s.slug])
        r = self.client.get(url)
        d = pq(r.content)
        eq_(s.title, d('h1.page-title').text())
        edit_link = d('ul.manage a.edit')
        assert not edit_link
コード例 #9
0
ファイル: test_views.py プロジェクト: craigcook/kuma
 def test_unicode(self):
     """
     Unicode characters in the summary or description doesn't brick the feed
     """
     s = save_valid_submission("ΦOTOS ftw", "ΦOTOS ΦOTOS ΦOTOS")
     s.featured = 1
     s.save()
     r = self.client.get(reverse("demos_feed_featured", args=["json"]))
     ok_(r.status_code == 200)
コード例 #10
0
ファイル: test_views.py プロジェクト: craigcook/kuma
 def test_edit_invalid(self):
     s = save_valid_submission()
     edit_url = reverse("demos_edit", args=[s.slug])
     r = self.client.post(edit_url, data=dict())
     d = pq(r.content)
     assert d("form#demo-submit")
     assert d("li#field_title ul.errorlist")
     assert d("li#field_summary ul.errorlist")
     assert d("li#field_license_name ul.errorlist")
コード例 #11
0
    def test_detail_censored(self):
        s = save_valid_submission('hello world')
        s.censored = True
        s.save()

        url = reverse('demos_detail', args=[s.slug])
        r = self.client.get(url)
        d = pq(r.content)
        eq_('Permission Denied', d('h1.page-title').text())
コード例 #12
0
ファイル: test_views.py プロジェクト: craigcook/kuma
    def test_detail(self):
        s = save_valid_submission("hello world")

        url = reverse("demos_detail", args=[s.slug])
        r = self.client.get(url)
        d = pq(r.content)
        eq_(s.title, d("h1.page-title").text())
        edit_link = d("ul.manage a.edit")
        assert not edit_link
コード例 #13
0
    def test_detail(self):
        s = save_valid_submission('hello world')

        url = reverse('demos_detail', args=[s.slug])
        r = self.client.get(url)
        d = pq(r.content)
        eq_(s.title, d('h1.page-title').text())
        edit_link = d('ul.manage a.edit')
        assert not edit_link
コード例 #14
0
 def test_edit_invalid(self):
     s = save_valid_submission()
     edit_url = reverse('demos_edit', args=[s.slug])
     r = self.client.post(edit_url, data=dict())
     d = pq(r.content)
     assert d('form#demo-submit')
     assert d('li#field_title ul.errorlist')
     assert d('li#field_summary ul.errorlist')
     assert d('li#field_license_name ul.errorlist')
コード例 #15
0
ファイル: test_views.py プロジェクト: tantek/kuma
    def test_detail_censored(self):
        s = save_valid_submission('hello world')
        s.censored = True
        s.save()

        url = reverse('demos_detail', args=[s.slug])
        r = self.client.get(url)
        d = pq(r.content)
        eq_('Permission Denied', d('h1.page-title').text())
コード例 #16
0
ファイル: test_views.py プロジェクト: craigcook/kuma
    def test_detail_censored(self):
        s = save_valid_submission("hello world")
        s.censored = True
        s.save()

        url = reverse("demos_detail", args=[s.slug])
        r = self.client.get(url)
        d = pq(r.content)
        eq_("Permission Denied", d("h1.page-title").text())
コード例 #17
0
 def test_unicode(self):
     """
     Unicode characters in the summary or description doesn't brick the feed
     """
     s = save_valid_submission('ΦOTOS ftw', 'ΦOTOS ΦOTOS ΦOTOS')
     s.featured = 1
     s.save()
     r = self.client.get(reverse('demos_feed_featured', args=['json']))
     ok_(r.status_code == 200)
コード例 #18
0
    def test_derby_tag_saving(self):
        """
        There's some tricky bits in the handling of editing and saving
        challenge tags; this test just exercises a cycle of edit/save
        a couple times in a row to make sure we don't go foul in
        there.
        
        """
        s = save_valid_submission('hello world')
        closed_dt = datetime.date.today() - datetime.timedelta(days=32)
        s.taggit_tags.set_ns('challenge:', closed_dt.strftime('%Y:%B').lower())
        edit_url = reverse('demos_edit', args=[s.slug])
        r = self.client.get(edit_url)
        eq_(r.status_code, 200)

        r = self.client.post(edit_url,
                             data=dict(
                                 title=s.title,
                                 summary='This is a test demo submission',
                                 description='Some description goes here',
                                 tech_tags=(
                                     'tech:audio',
                                     'tech:video',
                                     'tech:websockets',
                                 ),
                                 license_name='gpl',
                                 accept_terms='1',
                             ))

        eq_(302, r.status_code)
        assert 'Location' in r
        assert s.slug in r['Location']

        r = self.client.get(edit_url)
        eq_(r.status_code, 200)

        r = self.client.post(edit_url,
                             data=dict(
                                 title=s.title,
                                 summary='This is a test demo submission',
                                 description='Some description goes here',
                                 tech_tags=(
                                     'tech:audio',
                                     'tech:video',
                                     'tech:websockets',
                                 ),
                                 license_name='gpl',
                                 accept_terms='1',
                             ))

        eq_(302, r.status_code)
        assert 'Location' in r
        assert s.slug in r['Location']

        r = self.client.get(edit_url)
        eq_(r.status_code, 200)
コード例 #19
0
    def test_detail_censored_url(self):
        s = save_valid_submission('hello world')
        s.censored = True
        s.censored_url = "http://developer.mozilla.org"
        s.save()

        url = reverse('demos_detail', args=[s.slug])
        r = self.client.get(url)
        eq_(302, r.status_code)
        eq_("http://developer.mozilla.org", r['Location'])
コード例 #20
0
ファイル: test_views.py プロジェクト: craigcook/kuma
    def test_detail_censored_url(self):
        s = save_valid_submission("hello world")
        s.censored = True
        s.censored_url = "http://developer.mozilla.org"
        s.save()

        url = reverse("demos_detail", args=[s.slug])
        r = self.client.get(url)
        eq_(302, r.status_code)
        eq_("http://developer.mozilla.org", r["Location"])
コード例 #21
0
ファイル: test_views.py プロジェクト: craigcook/kuma
    def test_derby_tag_saving(self):
        """
        There's some tricky bits in the handling of editing and saving
        challenge tags; this test just exercises a cycle of edit/save
        a couple times in a row to make sure we don't go foul in
        there.

        """
        s = save_valid_submission("hello world")
        closed_dt = datetime.date.today() - datetime.timedelta(days=32)
        s.taggit_tags.set_ns("challenge:", closed_dt.strftime("%Y:%B").lower())
        edit_url = reverse("demos_edit", args=[s.slug])
        r = self.client.get(edit_url)
        eq_(r.status_code, 200)

        r = self.client.post(
            edit_url,
            data=dict(
                title=s.title,
                summary="This is a test demo submission",
                description="Some description goes here",
                tech_tags=("tech:audio", "tech:video", "tech:websockets"),
                license_name="gpl",
                accept_terms="1",
            ),
        )

        eq_(302, r.status_code)
        assert "Location" in r
        assert s.slug in r["Location"]

        r = self.client.get(edit_url)
        eq_(r.status_code, 200)

        r = self.client.post(
            edit_url,
            data=dict(
                title=s.title,
                summary="This is a test demo submission",
                description="Some description goes here",
                tech_tags=("tech:audio", "tech:video", "tech:websockets"),
                license_name="gpl",
                accept_terms="1",
            ),
        )

        eq_(302, r.status_code)
        assert "Location" in r
        assert s.slug in r["Location"]

        r = self.client.get(edit_url)
        eq_(r.status_code, 200)
コード例 #22
0
ファイル: test_views.py プロジェクト: trinaldi/kuma
 def test_edit_no_tags(self):
     s = save_valid_submission('hello world')
     edit_url = reverse('demos_edit', args=[s.slug])
     r = self.client.post(edit_url, data=dict(
         title=s.title,
         summary='This is a test edit',
         description='Some description goes here',
         license_name='gpl',
         accept_terms='1',
     ))
     eq_(r.status_code, 302)
     r = self.client.get(edit_url)
     eq_(r.status_code, 200)
コード例 #23
0
 def test_edit_no_tags(self):
     s = save_valid_submission('hello world')
     edit_url = reverse('demos_edit', args=[s.slug])
     r = self.client.post(edit_url, data=dict(
         title=s.title,
         summary='This is a test edit',
         description='Some description goes here',
         license_name='gpl',
         accept_terms='1',
     ))
     eq_(r.status_code, 302)
     r = self.client.get(edit_url)
     eq_(r.status_code, 200)
コード例 #24
0
ファイル: test_views.py プロジェクト: craigcook/kuma
    def test_long_slug(self):
        """
        A title longer than 50 characters should truncate to a
        50-character slug during (python-level) save, not on DB
        insertion, so that anything that wants the slug to build a URL
        has the value that actually ends up in the DB.

        """
        s = save_valid_submission("AudioVisualizer for Alternative Music Notation Systems")
        s.taggit_tags.set_ns("tech:", "javascript")
        s.save()
        ok_(len(s.slug) == 50)
        r = self.client.get(reverse("demos.views.detail", args=(s.slug,)))
        ok_(r.status_code == 200)
コード例 #25
0
 def test_long_slug(self):
     """
     A title longer than 50 characters should truncate to a
     50-character slug during (python-level) save, not on DB
     insertion, so that anything that wants the slug to build a URL
     has the value that actually ends up in the DB.
     
     """
     s = save_valid_submission("AudioVisualizer for Alternative Music Notation Systems")
     s.taggit_tags.set_ns('tech:', 'javascript')
     s.save()
     ok_(len(s.slug) == 50)
     r = self.client.get(reverse('demos.views.detail', args=(s.slug,)))
     ok_(r.status_code == 200)
コード例 #26
0
ファイル: test_views.py プロジェクト: craigcook/kuma
    def test_creator_can_edit(self):
        s = save_valid_submission("hello world")

        url = reverse("demos_detail", args=[s.slug])
        r = self.client.get(url)
        d = pq(r.content)
        edit_link = d("ul#demo-manage a.edit")
        assert edit_link
        edit_url = reverse("demos_edit", args=[s.slug], locale="en-US")
        eq_(edit_url, edit_link.attr("href"))

        r = self.client.get(edit_url)
        assert pq(r.content)("form#demo-submit")
        eq_("Save changes", pq(r.content)('p.fm-submit button[type="submit"]').text())
コード例 #27
0
ファイル: test_views.py プロジェクト: trinaldi/kuma
 def test_edit_with_challenge_tag(self):
     s = save_valid_submission('hello world')
     edit_url = reverse('demos_edit', args=[s.slug])
     r = self.client.post(edit_url, data=dict(
         title=s.title,
         summary='This is a test edit',
         description='Some description goes here',
         tech_tags=('tech:audio',),
         challenge_tags=parse_tags(constance.config.DEMOS_DEVDERBY_CHALLENGE_CHOICE_TAGS)[0],
         license_name='gpl',
         accept_terms='1',
     ))
     eq_(r.status_code, 302)
     r = self.client.get(edit_url)
     eq_(r.status_code, 200)
コード例 #28
0
 def test_edit_with_challenge_tag(self):
     s = save_valid_submission('hello world')
     edit_url = reverse('demos_edit', args=[s.slug])
     r = self.client.post(edit_url, data=dict(
         title=s.title,
         summary='This is a test edit',
         description='Some description goes here',
         tech_tags=('tech:audio',),
         challenge_tags=parse_tags(constance.config.DEMOS_DEVDERBY_CHALLENGE_CHOICE_TAGS)[0],
         license_name='gpl',
         accept_terms='1',
     ))
     eq_(r.status_code, 302)
     r = self.client.get(edit_url)
     eq_(r.status_code, 200)
コード例 #29
0
ファイル: test_views.py プロジェクト: tantek/kuma
    def test_creator_can_edit(self):
        s = save_valid_submission('hello world')

        url = reverse('demos_detail', args=[s.slug])
        r = self.client.get(url)
        d = pq(r.content)
        edit_link = d('ul#demo-manage a.edit')
        assert edit_link
        edit_url = reverse('demos_edit', args=[s.slug])
        eq_(edit_url, edit_link.attr("href"))

        r = self.client.get(edit_url)
        assert pq(r.content)('form#demo-submit')
        eq_('Save changes',
            pq(r.content)('p.fm-submit button[type="submit"]').text())
コード例 #30
0
    def test_creator_can_edit(self):
        s = save_valid_submission('hello world')

        url = reverse('demos_detail', args=[s.slug])
        r = self.client.get(url)
        d = pq(r.content)
        edit_link = d('ul#demo-manage a.edit')
        assert edit_link
        edit_url = reverse('demos_edit', args=[s.slug], locale='en-US')
        eq_(edit_url, edit_link.attr("href"))

        r = self.client.get(edit_url)
        assert pq(r.content)('form#demo-submit')
        eq_('Save changes',
            pq(r.content)('p.fm-submit button[type="submit"]').text())
コード例 #31
0
ファイル: test_views.py プロジェクト: craigcook/kuma
 def test_edit_no_tags(self):
     s = save_valid_submission("hello world")
     edit_url = reverse("demos_edit", args=[s.slug])
     r = self.client.post(
         edit_url,
         data=dict(
             title=s.title,
             summary="This is a test edit",
             description="Some description goes here",
             license_name="gpl",
             accept_terms="1",
         ),
     )
     eq_(r.status_code, 302)
     r = self.client.get(edit_url)
     eq_(r.status_code, 200)
コード例 #32
0
ファイル: test_views.py プロジェクト: trinaldi/kuma
    def test_derby_tag_saving(self):
        """
        There's some tricky bits in the handling of editing and saving
        challenge tags; this test just exercises a cycle of edit/save
        a couple times in a row to make sure we don't go foul in
        there.
        
        """
        s = save_valid_submission('hello world')
        closed_dt = datetime.date.today() - datetime.timedelta(days=32)
        s.taggit_tags.set_ns('challenge:', closed_dt.strftime('%Y:%B').lower())
        edit_url = reverse('demos_edit', args=[s.slug])
        r = self.client.get(edit_url)
        eq_(r.status_code, 200)
        
        r = self.client.post(edit_url, data=dict(
            title=s.title,
            summary='This is a test demo submission',
            description='Some description goes here',
            tech_tags=('tech:audio', 'tech:video', 'tech:websockets',),
            license_name='gpl',
            accept_terms='1',
        ))

        eq_(302, r.status_code)
        assert 'Location' in r
        assert 'hello-world' in r['Location']

        r = self.client.get(edit_url)
        eq_(r.status_code, 200)

        r = self.client.post(edit_url, data=dict(
            title=s.title,
            summary='This is a test demo submission',
            description='Some description goes here',
            tech_tags=('tech:audio', 'tech:video', 'tech:websockets',),
            license_name='gpl',
            accept_terms='1',
        ))

        eq_(302, r.status_code)
        assert 'Location' in r
        assert 'hello-world' in r['Location']

        r = self.client.get(edit_url)
        eq_(r.status_code, 200)
コード例 #33
0
ファイル: test_views.py プロジェクト: tantek/kuma
    def test_edit_valid(self):
        s = save_valid_submission()
        edit_url = reverse('demos_edit', args=[s.slug])
        r = self.client.post(edit_url, data=dict(
            title=s.title,
            summary='This is a test demo submission',
            description='Some description goes here',
            tech_tags=('tech:audio', 'tech:video', 'tech:websockets',),
            license_name='gpl',
            accept_terms='1',
        ))

        eq_(302, r.status_code)
        assert 'Location' in r
        assert 'hello-world' in r['Location']

        try:
            obj = Submission.objects.get(slug='hello-world')
            eq_('This is a test demo submission', obj.summary)
        except Submission.DoesNotExist:
            assert False
コード例 #34
0
ファイル: test_views.py プロジェクト: craigcook/kuma
    def test_edit_valid(self):
        s = save_valid_submission()
        edit_url = reverse("demos_edit", args=[s.slug])
        r = self.client.post(
            edit_url,
            data=dict(
                title=s.title,
                summary="This is a test demo submission",
                description="Some description goes here",
                tech_tags=("tech:audio", "tech:video", "tech:websockets"),
                license_name="gpl",
                accept_terms="1",
            ),
        )

        eq_(302, r.status_code)
        assert "Location" in r
        assert "hello-world" in r["Location"]

        try:
            obj = Submission.objects.get(slug="hello-world")
            eq_("This is a test demo submission", obj.summary)
        except Submission.DoesNotExist:
            assert False
コード例 #35
0
    def test_bug_702156(self):
        """Demo with missing screenshots should not cause exceptions in
        views"""
        # Create the submission...
        s = save_valid_submission('hello world')
        s.taggit_tags.set_ns('tech:', 'javascript')
        s.featured = True
        s.save()

        # Ensure the new screenshot and thumbnail URL code works when there's a
        # screenshot present.
        try:
            r = self.client.get(reverse('demos_all'))
            r = self.client.get(reverse('demos_tag', args=['tech:javascript']))
            r = self.client.get(reverse('demos_detail', args=[s.slug]))
            r = self.client.get(reverse('demos_feed_recent', args=['atom']))
            r = self.client.get(reverse('demos_feed_featured', args=['json']))
        except:
            ok_(False, "No exceptions should have been thrown")

        # Forcibly delete the screenshot - should not be possible from
        # user-facing UI per form validation, but we should at least not throw
        # exceptions.
        s.screenshot_1.storage.delete(s.screenshot_1.name)
        s.screenshot_1 = None
        s.save()

        # Big bucks, no whammies...
        try:
            r = self.client.get(reverse('demos_all'))
            r = self.client.get(reverse('demos_tag', args=['tech:javascript']))
            r = self.client.get(reverse('demos_detail', args=[s.slug]))
            r = self.client.get(reverse('demos_feed_recent', args=['atom']))
            r = self.client.get(reverse('demos_feed_featured', args=['json']))
        except:
            ok_(False, "No exceptions should have been thrown")
コード例 #36
0
ファイル: test_views.py プロジェクト: craigcook/kuma
    def test_missing_screenshots_no_exceptions(self):
        """Demo with missing screenshots should not cause exceptions in
        views"""
        # Create the submission...
        s = save_valid_submission("hello world")
        s.taggit_tags.set_ns("tech:", "javascript")
        s.featured = True
        s.save()

        # Ensure the new screenshot and thumbnail URL code works when there's a
        # screenshot present.
        try:
            r = self.client.get(reverse("demos_all"))
            r = self.client.get(reverse("demos_tag", args=["tech:javascript"]))
            r = self.client.get(reverse("demos_detail", args=[s.slug]))
            r = self.client.get(reverse("demos_feed_recent", args=["atom"]))
            r = self.client.get(reverse("demos_feed_featured", args=["json"]))
        except:
            ok_(False, "No exceptions should have been thrown")

        # Forcibly delete the screenshot - should not be possible from
        # user-facing UI per form validation, but we should at least not throw
        # exceptions.
        s.screenshot_1.storage.delete(s.screenshot_1.name)
        s.screenshot_1 = None
        s.save()

        # Big bucks, no whammies...
        try:
            r = self.client.get(reverse("demos_all"))
            r = self.client.get(reverse("demos_tag", args=["tech:javascript"]))
            r = self.client.get(reverse("demos_detail", args=[s.slug]))
            r = self.client.get(reverse("demos_feed_recent", args=["atom"]))
            r = self.client.get(reverse("demos_feed_featured", args=["json"]))
        except:
            ok_(False, "No exceptions should have been thrown")
コード例 #37
0
ファイル: test_views.py プロジェクト: craigcook/kuma
    def test_hidden_field(self):
        s = save_valid_submission("hello world")

        edit_url = reverse("demos_edit", args=[s.slug])
        r = self.client.get(edit_url)
        assert pq(r.content)('input[name="hidden"][type="checkbox"]')
コード例 #38
0
    def test_hidden_field(self):
        s = save_valid_submission('hello world')

        edit_url = reverse('demos_edit', args=[s.slug])
        r = self.client.get(edit_url)
        assert pq(r.content)('input[name="hidden"][type="checkbox"]')
コード例 #39
0
ファイル: test_views.py プロジェクト: craigcook/kuma
 def test_derby_before_deadline(self):
     s = save_valid_submission("hello world")
     s.taggit_tags.set_ns("challenge:", make_challenge_tag())
     form = SubmissionEditForm(instance=s)
     assert "demo_package" in form.fields
     assert "challenge_tags" in form.fields
コード例 #40
0
ファイル: test_views.py プロジェクト: craigcook/kuma
    def test_derby_field(self):
        s = save_valid_submission("hello world")

        edit_url = reverse("demos_edit", args=[s.slug])
        r = self.client.get(edit_url)
        assert pq(r.content)("fieldset#devderby-submit")
コード例 #41
0
ファイル: test_views.py プロジェクト: trinaldi/kuma
 def test_derby_before_deadline(self):
     s = save_valid_submission('hello world')
     s.taggit_tags.set_ns('challenge:', make_challenge_tag())
     form = SubmissionEditForm(instance=s)
     assert 'demo_package' in form.fields
     assert 'challenge_tags' in form.fields
コード例 #42
0
    def test_derby_field(self):
        s = save_valid_submission('hello world')

        edit_url = reverse('demos_edit', args=[s.slug])
        r = self.client.get(edit_url)
        assert pq(r.content)('fieldset#devderby-submit')
コード例 #43
0
 def test_derby_before_deadline(self):
     s = save_valid_submission('hello world')
     s.taggit_tags.set_ns('challenge:', make_challenge_tag())
     form = SubmissionEditForm(instance=s)
     assert 'demo_package' in form.fields
     assert 'challenge_tags' in form.fields