Beispiel #1
0
 def test_contribution_box(self):
     a = Addon.objects.get(pk=4664)
     a.suggested_amount = '12'
     s = contribution({'LANG': 'en-us', 'APP': amo.FIREFOX}, a)
     doc = PyQuery(s)
     # make sure input boxes are rendered correctly (bug 555867)
     assert doc('input[name=onetime-amount]').length == 1
     assert doc('input[name=monthly-amount]').length == 1
Beispiel #2
0
 def test_contribution_box(self):
     a = Addon.objects.get(pk=1003)
     a.suggested_amount = "12"
     s = contribution({"LANG": "en-us", "APP": amo.FIREFOX}, a)
     doc = PyQuery(s)
     # make sure input boxes are rendered correctly (bug 555867)
     assert doc("input[name=onetime-amount]").length == 1
     assert doc("input[name=monthly-amount]").length == 1
Beispiel #3
0
    def test_contribution_box(self):
        a = Addon.objects.get(pk=4664)
        a.suggested_amount = '12'

        settings = Mock()
        settings.MAX_CONTRIBUTION = 5

        c = {'LANG': 'en-us', 'APP': amo.FIREFOX, 'settings': settings}

        s = contribution(c, a)
        doc = PyQuery(s)
        # make sure input boxes are rendered correctly (bug 555867)
        assert doc('input[name=onetime-amount]').length == 1
        assert doc('input[name=monthly-amount]').length == 1
Beispiel #4
0
    def test_src_retained(self):
        a = Addon.objects.get(pk=7661)
        a.suggested_amount = '12'

        settings = Mock()
        settings.MAX_CONTRIBUTION = 5

        request = Mock()

        c = {'LANG': 'en-us', 'APP': amo.FIREFOX, 'settings': settings,
             'request': request}

        s = contribution(c, a, contribution_src='browse')
        doc = PyQuery(s)
        eq_(doc('input[name=source]').attr('value'), 'browse')
Beispiel #5
0
    def test_src_retained(self):
        a = Addon.objects.get(pk=7661)
        a.suggested_amount = '12'

        settings = Mock()
        settings.MAX_CONTRIBUTION = 5

        request = Mock()

        c = {'LANG': 'en-us', 'APP': amo.FIREFOX, 'settings': settings,
             'request': request}

        s = contribution(c, a, contribution_src='browse')
        doc = PyQuery(s)
        eq_(doc('input[name=source]').attr('value'), 'browse')
Beispiel #6
0
    def test_contribution_box(self):
        a = Addon.objects.get(pk=7661)
        a.suggested_amount = '12'

        settings = Mock()
        settings.MAX_CONTRIBUTION = 5

        request = Mock()
        request.GET = {'src': 'direct'}

        c = {'LANG': 'en-us', 'APP': amo.FIREFOX, 'settings': settings,
             'request': request}

        s = contribution(c, a)
        doc = PyQuery(s)
        # make sure input boxes are rendered correctly (bug 555867)
        assert doc('input[name=onetime-amount]').length == 1
Beispiel #7
0
    def test_contribution_box(self):
        a = Addon.objects.get(pk=7661)
        a.suggested_amount = '12'

        settings = Mock()
        settings.MAX_CONTRIBUTION = 5

        request = Mock()
        request.GET = {'src': 'direct'}

        c = {'LANG': 'en-us', 'APP': amo.FIREFOX, 'settings': settings,
             'request': request}

        s = contribution(c, a)
        doc = PyQuery(s)
        # make sure input boxes are rendered correctly (bug 555867)
        assert doc('input[name=onetime-amount]').length == 1