launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #08170
[Merge] lp:~wallyworld/launchpad/die-FileBugInlineFormView-die into lp:launchpad
Ian Booth has proposed merging lp:~wallyworld/launchpad/die-FileBugInlineFormView-die into lp:launchpad.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~wallyworld/launchpad/die-FileBugInlineFormView-die/+merge/107161
== Implementation ==
The FileBugInlineFormView class is not used anywhere except in tests. So it is removed.
== Tests ==
The tests which used FileBugInlineFormView were either deleted or updated to use create_initialised_view instead. The deleted tests were for bugtargets which redirected to other views.
== Lint ==
Checking for conflicts and issues in changed files.
Linting changed files:
lib/lp/bugs/browser/bugtarget.py
lib/lp/bugs/browser/tests/test_bugtarget_filebug.py
--
https://code.launchpad.net/~wallyworld/launchpad/die-FileBugInlineFormView-die/+merge/107161
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~wallyworld/launchpad/die-FileBugInlineFormView-die into lp:launchpad.
=== modified file 'lib/lp/bugs/browser/bugtarget.py'
--- lib/lp/bugs/browser/bugtarget.py 2012-04-19 03:17:23 +0000
+++ lib/lp/bugs/browser/bugtarget.py 2012-05-24 06:10:32 +0000
@@ -1002,11 +1002,6 @@
return True
-class FileBugInlineFormView(FileBugViewBase):
- """A browser view for displaying the inline filebug form."""
- schema = IBugAddForm
-
-
class FileBugAdvancedView(FileBugViewBase):
"""Browser view for filing a bug.
=== modified file 'lib/lp/bugs/browser/tests/test_bugtarget_filebug.py'
--- lib/lp/bugs/browser/tests/test_bugtarget_filebug.py 2012-04-19 06:24:16 +0000
+++ lib/lp/bugs/browser/tests/test_bugtarget_filebug.py 2012-05-24 06:10:32 +0000
@@ -13,7 +13,6 @@
from zope.security.proxy import removeSecurityProxy
from lp.bugs.browser.bugtarget import (
- FileBugInlineFormView,
FileBugViewBase,
)
from lp.bugs.interfaces.bug import (
@@ -51,7 +50,7 @@
# If there is not customized confirmation message, a default
# message is displayed.
product = self.factory.makeProduct()
- view = FileBugInlineFormView(product, LaunchpadTestRequest())
+ view = create_initialized_view(product, name='+filebug')
self.assertEqual(
u"Thank you for your bug report.",
view.getAcknowledgementMessage(product))
@@ -61,7 +60,7 @@
# FilebugViewBase.bug_reported_acknowledgement
product.bug_reported_acknowledgement = (
u"We really appreciate your bug report")
- view = FileBugInlineFormView(product, LaunchpadTestRequest())
+ view = create_initialized_view(product, name='+filebug')
self.assertEqual(
u"We really appreciate your bug report",
view.getAcknowledgementMessage(product))
@@ -69,7 +68,7 @@
# If the custom message is set to a string containing only white,
# space, the default message is used again.
product.bug_reported_acknowledgement = ' \t'
- view = FileBugInlineFormView(product, LaunchpadTestRequest())
+ view = create_initialized_view(product, name='+filebug')
self.assertEqual(
u"Thank you for your bug report.",
view.getAcknowledgementMessage(product))
@@ -83,7 +82,7 @@
# Without any customized bug filing confirmation message, the
# default message is used.
- view = FileBugInlineFormView(product, LaunchpadTestRequest())
+ view = create_initialized_view(product, name='+filebug')
self.assertEqual(
u"Thank you for your bug report.",
view.getAcknowledgementMessage(product))
@@ -91,7 +90,7 @@
# If the project group has a customized message, it is used.
project_group.bug_reported_acknowledgement = (
"Thanks for filing a bug for one of our many products.")
- view = FileBugInlineFormView(product, LaunchpadTestRequest())
+ view = create_initialized_view(product, name='+filebug')
self.assertEqual(
u"Thanks for filing a bug for one of our many products.",
view.getAcknowledgementMessage(product))
@@ -100,30 +99,11 @@
# message is used instead of the project group's message.
product.bug_reported_acknowledgement = (
u"Thanks for filing a bug for this very special product.")
- view = FileBugInlineFormView(product, LaunchpadTestRequest())
+ view = create_initialized_view(product, name='+filebug')
self.assertEqual(
u"Thanks for filing a bug for this very special product.",
view.getAcknowledgementMessage(product))
- def test_getAcknowledgementMessage_product_series(self):
- # If there is not customized confirmation message, a default
- # message is displayed.
- product_series = self.factory.makeProductSeries()
- view = FileBugInlineFormView(product_series, LaunchpadTestRequest())
- self.assertEqual(
- u"Thank you for your bug report.",
- view.getAcknowledgementMessage(product_series))
-
- # If a product contains a customized bug filing confirmation
- # message, it is retrieved for a product series context by
- # FilebugViewBase.bug_reported_acknowledgement
- product_series.product.bug_reported_acknowledgement = (
- u"We really appreciate your bug report")
- view = FileBugInlineFormView(product_series, LaunchpadTestRequest())
- self.assertEqual(
- u"We really appreciate your bug report",
- view.getAcknowledgementMessage(product_series))
-
def test_getAcknowledgementMessage_product_series_in_project_group(self):
# If a product_series is part of a project group and if the project
# group has a customized bug filing confirmation message,
@@ -134,7 +114,7 @@
# Without any customized bug filing confirmation message, the
# default message is used.
- view = FileBugInlineFormView(product_series, LaunchpadTestRequest())
+ view = create_initialized_view(product, name='+filebug')
self.assertEqual(
u"Thank you for your bug report.",
view.getAcknowledgementMessage(product_series))
@@ -142,7 +122,7 @@
# If the project group has a customized message, it is used.
project_group.bug_reported_acknowledgement = (
u"Thanks for filing a bug for one of our many product_seriess.")
- view = FileBugInlineFormView(product_series, LaunchpadTestRequest())
+ view = create_initialized_view(product, name='+filebug')
self.assertEqual(
u"Thanks for filing a bug for one of our many product_seriess.",
view.getAcknowledgementMessage(product_series))
@@ -151,7 +131,7 @@
# message is used instead of the project group's message.
product.bug_reported_acknowledgement = (
u"Thanks for filing a bug for this very special product.")
- view = FileBugInlineFormView(product_series, LaunchpadTestRequest())
+ view = create_initialized_view(product, name='+filebug')
self.assertEqual(
u"Thanks for filing a bug for this very special product.",
view.getAcknowledgementMessage(product_series))
@@ -160,7 +140,7 @@
# If there is not customized confirmation message, a default
# message is displayed.
distribution = self.factory.makeDistribution()
- view = FileBugInlineFormView(distribution, LaunchpadTestRequest())
+ view = create_initialized_view(distribution, name='+filebug')
self.assertEqual(
u"Thank you for your bug report.",
view.getAcknowledgementMessage(distribution))
@@ -170,54 +150,16 @@
# FilebugViewBase.bug_reported_acknowledgement
distribution.bug_reported_acknowledgement = (
u"We really appreciate your bug report")
- view = FileBugInlineFormView(distribution, LaunchpadTestRequest())
+ view = create_initialized_view(distribution, name='+filebug')
self.assertEqual(
u"We really appreciate your bug report",
view.getAcknowledgementMessage(distribution))
- def test_getAcknowledgementMessage_distroseries(self):
- # If there is not customized confirmation message, a default
- # message is displayed.
- distroseries = self.factory.makeDistroSeries()
- view = FileBugInlineFormView(distroseries, LaunchpadTestRequest())
- self.assertEqual(
- u"Thank you for your bug report.",
- view.getAcknowledgementMessage(distroseries))
-
- # DistroSeries objects do not have their own, independent
- # property bug_reported_acknowledgement; instead, it is
- # acquired from the parent distribution.
- distroseries.distribution.bug_reported_acknowledgement = (
- u"We really appreciate your bug report")
- view = FileBugInlineFormView(distroseries, LaunchpadTestRequest())
- self.assertEqual(
- u"We really appreciate your bug report",
- view.getAcknowledgementMessage(distroseries))
-
- def test_getAcknowledgementMessage_sourcepackage(self):
- # If there is not customized confirmation message, a default
- # message is displayed.
- sourcepackage = self.factory.makeSourcePackage()
- view = FileBugInlineFormView(sourcepackage, LaunchpadTestRequest())
- self.assertEqual(
- u"Thank you for your bug report.",
- view.getAcknowledgementMessage(sourcepackage))
-
- # SourcePackage objects do not have their own, independent
- # property bug_reported_acknowledgement; instead, it is
- # acquired from the parent distribution.
- sourcepackage.distribution.bug_reported_acknowledgement = (
- u"We really appreciate your bug report")
- view = FileBugInlineFormView(sourcepackage, LaunchpadTestRequest())
- self.assertEqual(
- u"We really appreciate your bug report",
- view.getAcknowledgementMessage(sourcepackage))
-
def test_getAcknowledgementMessage_distributionsourcepackage(self):
# If there is not customized confirmation message, a default
# message is displayed.
dsp = self.factory.makeDistributionSourcePackage()
- view = FileBugInlineFormView(dsp, LaunchpadTestRequest())
+ view = create_initialized_view(dsp, name='+filebug')
self.assertEqual(
u"Thank you for your bug report.",
view.getAcknowledgementMessage(dsp))
@@ -226,7 +168,7 @@
# the default message.
dsp.bug_reported_acknowledgement = (
u"We really appreciate your bug report")
- view = FileBugInlineFormView(dsp, LaunchpadTestRequest())
+ view = create_initialized_view(dsp, name='+filebug')
self.assertEqual(
u"We really appreciate your bug report",
view.getAcknowledgementMessage(dsp))
@@ -237,7 +179,7 @@
dsp = self.factory.makeDistributionSourcePackage()
dsp.distribution.bug_reported_acknowledgement = (
u"Thank you for filing a bug in our distribution")
- view = FileBugInlineFormView(dsp, LaunchpadTestRequest())
+ view = create_initialized_view(dsp, name='+filebug')
self.assertEqual(
u"Thank you for filing a bug in our distribution",
view.getAcknowledgementMessage(dsp))
@@ -246,7 +188,7 @@
# the message for the distribution.
dsp.bug_reported_acknowledgement = (
u"Thank you for filing a bug for this DSP")
- view = FileBugInlineFormView(dsp, LaunchpadTestRequest())
+ view = create_initialized_view(dsp, name='+filebug')
self.assertEqual(
u"Thank you for filing a bug for this DSP",
view.getAcknowledgementMessage(dsp))
@@ -256,7 +198,7 @@
# to the response.
product = self.factory.makeProduct()
login_person(product.owner)
- view = FileBugInlineFormView(product, LaunchpadTestRequest())
+ create_initialized_view(product, name='+filebug')
form_data = {
'title': 'A bug title',
'comment': 'whatever',
Follow ups