Exemplo n.º 1
0
    def test_get_context_data_one_star(self):
        """donate_stars_url should be undefined"""
        view = views.FeedbackView()
        view.request = RequestFactory().get('/?score=1')

        ctx = view.get_context_data()
        self.assertFalse('donate_stars_url' in ctx)
Exemplo n.º 2
0
 def test_get_template_names_unhappy(self):
     view = views.FeedbackView()
     view.request = RequestFactory().get('/?score=1')
     eq_(view.get_template_names(), ['firefox/feedback/unhappy.html'])
Exemplo n.º 3
0
    def test_get_context_data_five_stars(self):
        view = views.FeedbackView()
        view.request = RequestFactory().get('/?score=5')

        ctx = view.get_context_data()
        self.assertTrue(ctx['donate_stars_url'].endswith('Heartbeat_5stars'))
Exemplo n.º 4
0
 def test_get_template_names_happy(self):
     view = views.FeedbackView()
     view.request = RequestFactory().get('/?score=5')
     assert view.get_template_names() == ['firefox/feedback/happy.html']