~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/bugs/browser/tests/test_buglisting.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-09-29 20:54:34 UTC
  • mfrom: (14062.2.5 ask-question-from-bug)
  • Revision ID: launchpad@pqm.canonical.com-20110929205434-2tilu1e9q4s8d6hd
[r=jcsackett][bug=860565] Disable ask/convert to question in Bugs
 when the project does not use Answers.

Show diffs side-by-side

added added

removed removed

Lines of Context:
248
248
            bug_target.ubuntu_packages[0], force_local_path=True)
249
249
        self.assertEqual(link, content.a['href'])
250
250
 
 
251
    def test_ask_question_does_not_use_launchpad(self):
 
252
        bug_target = self._makeBugTargetProduct(
 
253
            bug_tracker='launchpad', packaging=True)
 
254
        login_person(bug_target.owner)
 
255
        bug_target.official_answers = False
 
256
        view = create_initialized_view(
 
257
            bug_target, '+bugs', principal=bug_target.owner)
 
258
        self.assertEqual(None, view.addquestion_url)
 
259
 
 
260
    def test_ask_question_uses_launchpad(self):
 
261
        bug_target = self._makeBugTargetProduct(
 
262
            bug_tracker='launchpad', packaging=True)
 
263
        login_person(bug_target.owner)
 
264
        bug_target.official_answers = True
 
265
        view = create_initialized_view(
 
266
            bug_target, '+bugs', principal=bug_target.owner)
 
267
        url = canonical_url(
 
268
            bug_target, rootsite='answers', view_name='+addquestion')
 
269
        self.assertEqual(url, view.addquestion_url)
 
270
 
251
271
 
252
272
class TestBugTaskSearchListingViewDSP(BugTargetTestCase):
253
273