示例#1
0
    def test_preload_on_status_page(self, noop1, noop2):
        req = req_factory_factory(self.url, user=self.user)
        r = status(req, self.webapp.slug)
        doc = pq(r.content)
        eq_(doc("#preload .listing-footer a").attr("href"), self.webapp.get_dev_url("preload_home"))
        assert doc("#preload .not-submitted")

        self._submit_pdf()

        req = req_factory_factory(self.url, user=self.user)
        r = status(req, self.webapp.slug)
        doc = pq(r.content)
        eq_(doc("#preload .listing-footer a").attr("href"), self.webapp.get_dev_url("preload_submit"))
        assert doc("#preload .submitted")
示例#2
0
    def test_outdated(self, noop, save_mock):
        self._submit_pdf()

        req = req_factory_factory(self.url, user=self.user)
        r = status(req, self.webapp.app_slug)
        doc = pq(r.content)
        assert doc('.outdated')
示例#3
0
    def test_preload_on_status_page(self, noop1, noop2):
        req = req_factory_factory(self.url, user=self.user)
        r = status(req, self.webapp.app_slug)
        doc = pq(r.content)
        eq_(doc('#preload .listing-footer a').attr('href'),
            self.webapp.get_dev_url('preload_home'))
        assert doc('#preload .not-submitted')

        self._submit_pdf()

        req = req_factory_factory(self.url, user=self.user)
        r = status(req, self.webapp.app_slug)
        doc = pq(r.content)
        eq_(doc('#preload .listing-footer a').attr('href'),
            self.webapp.get_dev_url('preload_submit'))
        assert doc('#preload .submitted')
示例#4
0
    def test_outdated(self, noop, save_mock):
        self._submit_pdf()

        req = req_factory_factory(self.url, user=self.user)
        r = status(req, self.webapp.slug)
        doc = pq(r.content)
        assert doc('.outdated')
    def test_preload_on_status_page(self, noop1, noop2):
        req = req_factory_factory(self.url, user=self.user)
        r = status(req, self.webapp.slug)
        doc = pq(r.content)
        eq_(doc('#preload .listing-footer a').attr('href'),
            self.webapp.get_dev_url('preload_home'))
        assert doc('#preload .not-submitted')

        self._submit_pdf()

        req = req_factory_factory(self.url, user=self.user)
        r = status(req, self.webapp.slug)
        doc = pq(r.content)
        eq_(doc('#preload .listing-footer a').attr('href'),
            self.webapp.get_dev_url('preload_submit'))
        assert doc('#preload .submitted')
示例#6
0
    def test_submit_multiple_status(self, noop, save_mock):
        f = open(self.test_xls, "r")
        req = req_factory_factory(self.submit_url, user=self.user, post=True, data={"test_plan": f, "agree": True})
        preload_submit(req, self.webapp.slug)
        self._submit_pdf()

        eq_(PreloadTestPlan.objects.count(), 2)
        xls = PreloadTestPlan.objects.get(filename__contains="xls")
        pdf = PreloadTestPlan.objects.get(filename__contains="pdf")
        eq_(xls.status, amo.STATUS_DISABLED)
        eq_(pdf.status, amo.STATUS_PUBLIC)

        # Check the link points to most recent one.
        req = req_factory_factory(self.url, user=self.user)
        r = status(req, self.webapp.slug)
        doc = pq(r.content)
        eq_(doc(".test-plan-download").attr("href"), pdf.preload_test_plan_url)
示例#7
0
    def test_submit_multiple_status(self, noop, save_mock):
        f = open(self.test_xls, 'r')
        req = req_factory_factory(self.submit_url, user=self.user, post=True,
                                  data={'test_plan': f, 'agree': True})
        preload_submit(req, self.webapp.app_slug)
        self._submit_pdf()

        eq_(PreloadTestPlan.objects.count(), 2)
        xls = PreloadTestPlan.objects.get(filename__contains='xls')
        pdf = PreloadTestPlan.objects.get(filename__contains='pdf')
        eq_(xls.status, mkt.STATUS_DISABLED)
        eq_(pdf.status, mkt.STATUS_PUBLIC)

        # Check the link points to most recent one.
        req = req_factory_factory(self.url, user=self.user)
        r = status(req, self.webapp.app_slug)
        doc = pq(r.content)
        eq_(doc('.test-plan-download').attr('href').split('?')[0],
            pdf.preload_test_plan_url.split('?')[0])
    def test_submit_multiple_status(self, noop, save_mock):
        f = open(self.test_xls, 'r')
        req = req_factory_factory(self.submit_url, user=self.user, post=True,
                                  data={'test_plan': f, 'agree': True})
        preload_submit(req, self.webapp.slug)
        self._submit_pdf()

        eq_(PreloadTestPlan.objects.count(), 2)
        xls = PreloadTestPlan.objects.get(filename__contains='xls')
        pdf = PreloadTestPlan.objects.get(filename__contains='pdf')
        eq_(xls.status, amo.STATUS_DISABLED)
        eq_(pdf.status, amo.STATUS_PUBLIC)

        # Check the link points to most recent one.
        req = req_factory_factory(self.url, user=self.user)
        r = status(req, self.webapp.slug)
        doc = pq(r.content)
        eq_(doc('.test-plan-download').attr('href'),
            pdf.preload_test_plan_url)