コード例 #1
0
    def test_library_view_show_zipfile(self):
        """
        Test our library management view when we have zipfile configured.  Should
        show our zipfile info.  (The rest of the library management page is tested
        in ``LibraryViewTests``)
        """

        self.login()
        response = self.client.get(reverse('exordium:library'))
        self.assertEqual(response.status_code, 200)

        App.ensure_prefs()
        self.assertContains(response, 'Zipfile Support:</strong> Yes')
        self.assertNotContains(response, 'Zipfile Support:</strong> No')
        self.assertContains(response, App.prefs['exordium__zipfile_url'])
        self.assertContains(response, App.prefs['exordium__zipfile_path'])
コード例 #2
0
    def test_with_permission(self):
        """
        Test when we're logged in.
        """

        self.login()
        response = self.client.get(reverse('exordium:library'))
        self.assertEqual(response.status_code, 200)
        self.assertContains(response, reverse('exordium:library_update'))

        # We should show our library config, and not have zipfile info
        App.ensure_prefs()
        self.assertContains(response, App.prefs['exordium__base_path'])
        self.assertContains(response, App.prefs['exordium__media_url_html5'])
        self.assertContains(response, App.prefs['exordium__media_url_m3u'])
        self.assertNotContains(response, 'Zipfile Support:</strong> Yes')
        self.assertContains(response, 'Zipfile Support:</strong> No')