コード例 #1
0
ファイル: test_views.py プロジェクト: harisonmg/jmad
    def test_basic(self):
        """
        Test that the solo view returns a 200 response and uses
        The correct template
        """
        request = self.factory.get(
            '/solos/no-funny-hats/bugle-call-rag/buddy-rich/')

        response = solo_detail(request,
                               album=self.no_funny_hats.slug,
                               track=self.bugle_call_rag.slug,
                               artist=self.drum_solo.slug)

        with self.assertTemplateUsed('solos/solo_detail.html'):
            response = solo_detail(request,
                                   album=self.no_funny_hats.slug,
                                   track=self.bugle_call_rag.slug,
                                   artist=self.drum_solo.slug)

        self.assertEqual(response.status_code, 200)

        page = response.content.decode()
        self.assertInHTML('<p id="jmad-artist">Rich</p>', page)
        self.assertInHTML('<p id="jmad-track">Bugle Call Rag  [1 solo]</p>',
                          page)
コード例 #2
0
ファイル: test_views.py プロジェクト: priestd09/jmad
    def test_basic(self):
        """
        Test that the solo view returns a 200 response, uses the correct template, and has the correct context
        """
        request = self.factory.get('/solos/no-funny-hats/bugle-call-rag/buddy-rich/')

        with self.assertTemplateUsed('solos/solo_detail.html'):
            response = solo_detail(request, album=self.no_funny_hats.slug, track=self.bugle_call_rag.slug,
                                   artist=self.drum_solo.slug)

            self.assertEqual(response.status_code, 200)
            page = response.content.decode()
            self.assertInHTML('<p id="jmad-artist">Buddy Rich</p>', page)
            self.assertInHTML('<p id="jmad-track">Bugle Call Rag [1 solo]</p>', page)