Merge lp:~wallyworld/launchpad/fix-hardcoded-test-urls into lp:launchpad/db-devel

Proposed by Ian Booth on 2010-10-18
Status: Merged
Approved by: Robert Collins on 2010-10-19
Approved revision: no longer in the source branch.
Merged at revision: 9921
Proposed branch: lp:~wallyworld/launchpad/fix-hardcoded-test-urls
Merge into: lp:launchpad/db-devel
Diff against target: 1708 lines (+306/-191)
59 files modified
lib/canonical/config/__init__.py (+12/-2)
lib/canonical/launchpad/doc/launchpadlib.txt (+13/-7)
lib/canonical/launchpad/testing/browser.py (+16/-0)
lib/canonical/launchpad/webapp/tests/cookie-authentication.txt (+21/-11)
lib/canonical/launchpad/webapp/tests/login.txt (+9/-6)
lib/canonical/launchpad/webapp/tests/no-anonymous-session-cookies.txt (+6/-4)
lib/canonical/launchpad/webapp/tests/test_login.py (+6/-5)
lib/canonical/testing/__init__.py (+1/-0)
lib/canonical/testing/layers.py (+19/-10)
lib/lp/bugs/windmill/testing.py (+5/-1)
lib/lp/bugs/windmill/tests/test_bug_also_affects_new_upstream.py (+18/-12)
lib/lp/bugs/windmill/tests/test_bug_commenting.py (+1/-1)
lib/lp/bugs/windmill/tests/test_bug_inline_subscriber.py (+11/-9)
lib/lp/bugs/windmill/tests/test_bug_me_too.py (+1/-1)
lib/lp/bugs/windmill/tests/test_bug_privacy_settings.py (+6/-5)
lib/lp/bugs/windmill/tests/test_filebug_dupe_finder.py (+3/-3)
lib/lp/bugs/windmill/tests/test_filebug_extra_options.py (+1/-1)
lib/lp/bugs/windmill/tests/test_mark_duplicate.py (+2/-2)
lib/lp/bugs/windmill/tests/test_official_bug_tags_management.py (+1/-1)
lib/lp/code/model/tests/test_sourcepackagerecipe.py (+1/-1)
lib/lp/code/windmill/testing.py (+5/-1)
lib/lp/code/windmill/tests/test_branch_bugspeclinks.py (+1/-1)
lib/lp/code/windmill/tests/test_branch_subscriptions.py (+2/-2)
lib/lp/code/windmill/tests/test_branchmergeproposal_review.py (+1/-1)
lib/lp/code/windmill/tests/test_productseries_setbranch.py (+1/-1)
lib/lp/registry/windmill/testing.py (+5/-1)
lib/lp/registry/windmill/tests/test_add_bugtracker.py (+2/-1)
lib/lp/registry/windmill/tests/test_add_milestone.py (+1/-1)
lib/lp/registry/windmill/tests/test_datetime_picker.py (+2/-1)
lib/lp/registry/windmill/tests/test_person_picker.py (+2/-1)
lib/lp/registry/windmill/tests/test_plusnew_step1.py (+2/-1)
lib/lp/registry/windmill/tests/test_plusnew_step2.py (+2/-1)
lib/lp/registry/windmill/tests/test_product.py (+2/-2)
lib/lp/registry/windmill/tests/test_product_edit_people.py (+2/-2)
lib/lp/registry/windmill/tests/test_project_licenses.py (+4/-2)
lib/lp/registry/windmill/tests/test_team_index.py (+1/-1)
lib/lp/registry/windmill/tests/test_timeline_graph.py (+7/-4)
lib/lp/services/mailman/doc/contact-address.txt (+13/-10)
lib/lp/services/mailman/doc/create-lists.txt (+3/-1)
lib/lp/services/mailman/doc/deactivate-lists.txt (+3/-1)
lib/lp/services/mailman/doc/decorations.txt (+3/-1)
lib/lp/services/mailman/doc/modify-lists.txt (+3/-1)
lib/lp/services/mailman/doc/postings.txt (+13/-17)
lib/lp/services/mailman/doc/reactivate-lists.txt (+3/-1)
lib/lp/services/mailman/doc/recovery.txt (+4/-2)
lib/lp/services/mailman/testing/helpers.py (+2/-2)
lib/lp/soyuz/windmill/testing.py (+7/-1)
lib/lp/soyuz/windmill/tests/test_archive_packages.py (+2/-1)
lib/lp/soyuz/windmill/tests/test_archivesubscribersindex.py (+3/-2)
lib/lp/soyuz/windmill/tests/test_ppainlineedit.py (+1/-1)
lib/lp/testing/__init__.py (+7/-4)
lib/lp/testing/factory.py (+2/-1)
lib/lp/translations/windmill/testing.py (+5/-1)
lib/lp/translations/windmill/tests/disabled_test_productseries_templates.py (+2/-2)
lib/lp/translations/windmill/tests/test_documentation_links.py (+4/-4)
lib/lp/translations/windmill/tests/test_import_queue.py (+1/-1)
lib/lp/translations/windmill/tests/test_languages.py (+1/-1)
lib/lp/translations/windmill/tests/test_pofile_translate.py (+28/-28)
lib/lp/translations/windmill/tests/test_serieslanguages.py (+1/-2)
To merge this branch: bzr merge lp:~wallyworld/launchpad/fix-hardcoded-test-urls
Reviewer Review Type Date Requested Status
Robert Collins (community) 2010-10-18 Approve on 2010-10-19
Ian Booth (community) Resubmit on 2010-10-19
Review via email: mp+38779@code.launchpad.net

Commit Message

Remove hard coded urls from various tests.

Description of the Change

This branch is part of the effort to support parallel test runs. It removes the use of hard coded urls (in particular port numbers) in doc, windmill, yui and unit tests. Currently, when running tests, the (only) test app server instance is run up on port 8085, which results in urls like "http://launchpad.dev:8085/xxxx"; such urls are then used a string literals in tests eg browser.open("http://launchpad.dev:8085/xxxx"). This practice is not compatible with the need to allow the root url to be defined on the fly so that multiple test instances can be run in parallel.

Implementation
--------------------

The CanonicalConfig class has a new method:
    def root_launchpad_url(self, facet='mainsite', ensureSlash=False):
        """Return the correct root url for the given facet."""

So for a given config in use when running tests, it is possible to find out what the correct root url to use is. eg

facet='mainsite' -> http://launchpad.dev:<port>
facet ='code' -> http://code.launchpad.dev:<port> etc

At the moment, there's only one possible named config - 'testrunner-appserver' but with other changes being done to support parallel tests, this name will be parameterised. A class method has been added to BaseLayer to allow the correct config instance to be retrieved:

    @classmethod
    def getAppServerConfig(cls):
        """Return a config suitable for AppServer tests."""
        # XXX wallyworld 2010-10-18
        # use BaseLayer.appserver_config_name when available
        return CanonicalConfig('testrunner-appserver')

To make it easy for test code to simply get the correct root url instead of using a hard coded string literal, helper methods have been added to canonical/testing/__init__.py

def getAppServerConfig():
    """Return a config suitable for AppServer tests."""
    return BaseLayer.getAppServerConfig()

def getRootLaunchpadUrl(facet='mainsite', ensureSlash=False):
    """Return the correct root url for the given facet."""
    return getAppServerConfig().root_launchpad_url(facet, ensureSlash)

So test code can do stuff like the following, which is pretty straight forward:

New:

from canonical.testing import getRootLaunchpadUrl
root_url = getRootLaunchpadUrl()

Old:

root_url = 'http://launchpad.dev:8085'

For doc tests, it was necessary to add some extra properties to canonical/launchpad/testing/browser.Browser:
- vhost
- rooturl
- urlpath
These enabled expected output tests to be refactored to remove the reference to the hard coded port number.

For windmill tests, the BaseWindmillLayer class has a base_url property. This property is now set during the test set up using the root url derived from the config instance. Existing windmill code was perhaps poorly written in that despite this base_url property being available, hard coded urls were still used. So there were simple replaced with references to the base_url property.

Next Steps
--------------

Once this branch lands, and once the branch lp:~lifeless/launchpad/uniqueconfig lands, then the next step is to remove the hard coded app server config name 'testrunner-appserver' and use the parameterised one from BaseLayer instead.

Tests
------

bin/test -vvt launchpadlib.txt
bin/test -vvt cookie-authentication.txt
bin/test -vvt login.txt
bin/test -vvt no-anonymous-session-cookies.txt
bin/test -vvt webapp.tests.test_login
bin/test -vvt shipit-login.txt
bin/test -vvt windmill
bin/test -vvt test_sourcepackagerecipe
bin/test -vvt test_productseries_setbranch
bin/test -vvt test_yui

Lint
----

Some drive by lint fixes were done. The remaining issues were already in the code base.

bin/lint.sh
= Launchpad lint =

Checking for conflicts and issues in changed files.

Linting changed files:
  lib/canonical/config/__init__.py
  lib/canonical/launchpad/doc/launchpadlib.txt
  lib/canonical/launchpad/testing/browser.py
  lib/canonical/launchpad/webapp/tests/cookie-authentication.txt
  lib/canonical/launchpad/webapp/tests/login.txt
  lib/canonical/launchpad/webapp/tests/no-anonymous-session-cookies.txt
  lib/canonical/launchpad/webapp/tests/test_login.py
  lib/canonical/testing/__init__.py
  lib/canonical/testing/layers.py
  lib/lp/bugs/windmill/testing.py
  lib/lp/bugs/windmill/tests/test_bug_also_affects_new_upstream.py
  lib/lp/bugs/windmill/tests/test_bug_commenting.py
  lib/lp/bugs/windmill/tests/test_bug_inline_subscriber.py
  lib/lp/bugs/windmill/tests/test_bug_me_too.py
  lib/lp/bugs/windmill/tests/test_bug_privacy_settings.py
  lib/lp/bugs/windmill/tests/test_filebug_dupe_finder.py
  lib/lp/bugs/windmill/tests/test_filebug_extra_options.py
  lib/lp/bugs/windmill/tests/test_mark_duplicate.py
  lib/lp/bugs/windmill/tests/test_official_bug_tags_management.py
  lib/lp/code/model/tests/test_sourcepackagerecipe.py
  lib/lp/code/windmill/testing.py
  lib/lp/code/windmill/tests/test_branch_bugspeclinks.py
  lib/lp/code/windmill/tests/test_branch_subscriptions.py
  lib/lp/code/windmill/tests/test_branchmergeproposal_review.py
  lib/lp/code/windmill/tests/test_productseries_setbranch.py
  lib/lp/registry/windmill/testing.py
  lib/lp/registry/windmill/tests/test_add_bugtracker.py
  lib/lp/registry/windmill/tests/test_add_milestone.py
  lib/lp/registry/windmill/tests/test_datetime_picker.py
  lib/lp/registry/windmill/tests/test_person_picker.py
  lib/lp/registry/windmill/tests/test_plusnew_step1.py
  lib/lp/registry/windmill/tests/test_plusnew_step2.py
  lib/lp/registry/windmill/tests/test_product.py
  lib/lp/registry/windmill/tests/test_product_edit_people.py
  lib/lp/registry/windmill/tests/test_project_licenses.py
  lib/lp/registry/windmill/tests/test_team_index.py
  lib/lp/registry/windmill/tests/test_timeline_graph.py
  lib/lp/services/mailman/doc/contact-address.txt
  lib/lp/services/mailman/doc/create-lists.txt
  lib/lp/services/mailman/doc/deactivate-lists.txt
  lib/lp/services/mailman/doc/decorations.txt
  lib/lp/services/mailman/doc/modify-lists.txt
  lib/lp/services/mailman/doc/postings.txt
  lib/lp/services/mailman/doc/reactivate-lists.txt
  lib/lp/services/mailman/doc/recovery.txt
  lib/lp/services/mailman/testing/helpers.py
  lib/lp/soyuz/windmill/testing.py
  lib/lp/soyuz/windmill/tests/test_archive_packages.py
  lib/lp/soyuz/windmill/tests/test_archivesubscribersindex.py
  lib/lp/soyuz/windmill/tests/test_ppainlineedit.py
  lib/lp/testing/__init__.py
  lib/lp/testing/factory.py
  lib/lp/translations/windmill/testing.py
  lib/lp/translations/windmill/tests/disabled_test_productseries_templates.py
  lib/lp/translations/windmill/tests/test_documentation_links.py
  lib/lp/translations/windmill/tests/test_import_queue.py
  lib/lp/translations/windmill/tests/test_languages.py
  lib/lp/translations/windmill/tests/test_pofile_translate.py
  lib/lp/translations/windmill/tests/test_serieslanguages.py

./lib/canonical/config/__init__.py
     330: W602 deprecated form of raising exception
     332: W602 deprecated form of raising exception
     334: W602 deprecated form of raising exception
     376: E202 whitespace before ')'
./lib/canonical/launchpad/doc/launchpadlib.txt
       1: narrative uses a moin header.
./lib/canonical/launchpad/webapp/tests/cookie-authentication.txt
      22: want exceeds 78 characters.
./lib/canonical/launchpad/webapp/tests/login.txt
      20: want exceeds 78 characters.
./lib/canonical/launchpad/webapp/tests/no-anonymous-session-cookies.txt
      24: want exceeds 78 characters.
./lib/canonical/testing/__init__.py
      83: 'from canonical.testing.layers import *' used; unable to detect undefined names
      79: 'canonical' imported but unused
./lib/canonical/testing/layers.py
      84: redefinition of unused 'zope' from line 83
     532: redefinition of unused 'pidfile' from line 96
     332: E231 missing whitespace after ','
     400: E202 whitespace before ')'
     475: E302 expected 2 blank lines, found 1
     592: E202 whitespace before ')'
     608: E202 whitespace before ')'
     628: E202 whitespace before ')'
     742: E202 whitespace before ')'
     869: E301 expected 1 blank line, found 0
     878: W291 trailing whitespace
    1010: E301 expected 1 blank line, found 2
    1037: E202 whitespace before ')'
    1047: E202 whitespace before ')'
    1093: E202 whitespace before ')'
    1114: E202 whitespace before ')'
    1152: E301 expected 1 blank line, found 2
    1249: E301 expected 1 blank line, found 0
    1312: E302 expected 2 blank lines, found 3
    1410: E202 whitespace before ')'
    1423: E202 whitespace before ')'
    1427: E301 expected 1 blank line, found 2
    1511: E301 expected 1 blank line, found 0
    1531: E301 expected 1 blank line, found 0
    1561: E301 expected 1 blank line, found 2
    1619: E301 expected 1 blank line, found 0
     878: Line has trailing whitespace.
     883: Line exceeds 78 characters.
./lib/lp/bugs/windmill/testing.py
      12: 'config' imported but unused
./lib/lp/bugs/windmill/tests/test_bug_also_affects_new_upstream.py
      21: E302 expected 2 blank lines, found 1
      37: E501 line too long (81 characters)
      38: E501 line too long (82 characters)
      39: E501 line too long (81 characters)
      58: E302 expected 2 blank lines, found 1
      37: Line exceeds 78 characters.
      38: Line exceeds 78 characters.
      39: Line exceeds 78 characters.
./lib/lp/bugs/windmill/tests/test_bug_inline_subscriber.py
      20: E302 expected 2 blank lines, found 1
     249: E302 expected 2 blank lines, found 1
./lib/lp/bugs/windmill/tests/test_bug_me_too.py
      24: E302 expected 2 blank lines, found 1
      33: E301 expected 1 blank line, found 0
     126: E302 expected 2 blank lines, found 1
./lib/lp/bugs/windmill/tests/test_bug_privacy_settings.py
     179: E302 expected 2 blank lines, found 1
./lib/lp/bugs/windmill/tests/test_filebug_dupe_finder.py
      33: E302 expected 2 blank lines, found 1
     122: E302 expected 2 blank lines, found 1
./lib/lp/bugs/windmill/tests/test_mark_duplicate.py
     145: E302 expected 2 blank lines, found 1
./lib/lp/bugs/windmill/tests/test_official_bug_tags_management.py
     214: E302 expected 2 blank lines, found 1
./lib/lp/code/windmill/tests/test_productseries_setbranch.py
      56: E302 expected 2 blank lines, found 1
./lib/lp/registry/windmill/tests/test_add_milestone.py
       9: 'time' imported but unused
./lib/lp/registry/windmill/tests/test_timeline_graph.py
      81: E302 expected 2 blank lines, found 1
./lib/lp/services/mailman/testing/helpers.py
     167: E202 whitespace before ']'
     299: E301 expected 1 blank line, found 0
     306: E301 expected 1 blank line, found 0
./lib/lp/soyuz/windmill/tests/test_archivesubscribersindex.py
     102: E302 expected 2 blank lines, found 1
./lib/lp/testing/__init__.py
     132: 'anonymous_logged_in' imported but unused
     132: 'with_anonymous_login' imported but unused
     132: 'is_logged_in' imported but unused
     151: 'launchpadlib_for' imported but unused
     151: 'launchpadlib_credentials_for' imported but unused
     132: 'person_logged_in' imported but unused
     151: 'oauth_access_token_for' imported but unused
     132: 'login_celebrity' imported but unused
     132: 'with_celebrity_logged_in' imported but unused
     150: 'test_tales' imported but unused
     132: 'celebrity_logged_in' imported but unused
     132: 'run_with_login' imported but unused
     132: 'with_person_logged_in' imported but unused
     132: 'login_team' imported but unused
     132: 'login_person' imported but unused
     132: 'login_as' imported but unused
     447: E301 expected 1 blank line, found 0
     878: E301 expected 1 blank line, found 0
     904: E302 expected 2 blank lines, found 1
     980: E302 expected 2 blank lines, found 1
./lib/lp/testing/factory.py
    3157: redefinition of function 'makePackageDiff' from line 1847
./lib/lp/translations/windmill/tests/test_pofile_translate.py
      78: E202 whitespace before ')'
     494: W391 blank line at end of file
./lib/lp/translations/windmill/tests/test_serieslanguages.py
      81: W391 blank line at end of file

To post a comment you must log in.
Robert Collins (lifeless) wrote :

A few thoughts.

Those helper methods are coupled to BaseLayer; why not put them on BaseLayer? At the moment it looks a bit fragmented.

Rather than hardcoding with an XXX, if you do

    cls.appserver_config_name = 'testrunner-appserver'

in BaseLayer.setUp, your code won't need changing at all when uniqueconfig lands.

review: Approve
Ian Booth (wallyworld) wrote :

On 19/10/10 08:58, Robert Collins wrote:
> Review: Approve
> A few thoughts.
>
> Those helper methods are coupled to BaseLayer; why not put them on BaseLayer? At the moment it looks a bit fragmented.
>

My thoughts were that I wanted to have "standalone" helper methods which
were independent of any implementation details. So I think you are
proposing:

from canonical.testing.layers import BaseLayer
root_url = BaseLayer.getRootLaunchpadUrl()

or even

from canonical.testing.layers import BaseLayer
root_url = BaseLayer.getAppServerConfig().root_launchpad_url()

instead of

from canonical.testing import getRootLaunchpadUrl
root_url = getRootLaunchpadUrl()

I wanted to hide how the root url was determined and to decouple the
underlying implementation from the innovation method. So the caller has
no knowledge or code dependency on how the root url or app server config
is retrieved. Maybe it's YAGNI, but I wanted to allow the implementation
change without needing to go back and change lots of existing test code.

I could loose the getRootLaunchpadUrl() method and just do:

from canonical.testing import getAppServerConfig
root_url = getAppServerConfig().root_launchpad_url()

but I though it was such a common operation that it perhaps deserved
it's own "shortcut".

Do you agree that there's merit in my approach? Do you want me to change
it? Perhaps I should just ditch the getRootLaunchpadUrl() method?
Recommendations?

> Rather than hardcoding with an XXX, if you do
>
> cls.appserver_config_name = 'testrunner-appserver'
>
> in BaseLayer.setUp, your code won't need changing at all when uniqueconfig lands.

Yes, good idea, thanks.

Ian Booth (wallyworld) wrote :

>
> Rather than hardcoding with an XXX, if you do
>
> cls.appserver_config_name = 'testrunner-appserver'
>
> in BaseLayer.setUp, your code won't need changing at all when uniqueconfig lands.

Bollocks. The Windmill layers need work to support this since they set
their base_url at class instantiation time. I need to go and add setUp()
methods to these layers.

Robert Collins (lifeless) wrote :

On Tue, Oct 19, 2010 at 12:31 PM, Ian Booth <email address hidden> wrote:
>>
>> Rather than hardcoding with an XXX, if you do
>>
>>     cls.appserver_config_name = 'testrunner-appserver'
>>
>> in BaseLayer.setUp, your code won't need changing at all when uniqueconfig lands.
>
> Bollocks. The Windmill layers need work to support this since they set
> their base_url at class instantiation time. I need to go and add setUp()
> methods to these layers.

Heh, if its hard, don't bother in this landing, just iterate on it.

Re the helper methods.

Helper methods that hide global state terrify me.

Helper methods that are reusable are totally cool.

The ones you have actually are depending on global state; state that
has a home - BaseLayer.
You could have
appserver_root_url(BaseLayer)

or some such. I think that avoiding deep dotted notation is a good
idea. (Law of demeter).

Certainly at least one of your functions depends totally on BaseLayer,
and I don't see it making any sense as anything other than a method.

A test I like to use is 'does this thing make sense in a different
context'? -> No, it should be a method, or at least a helper that
takes a thing matching some protocol to work with. Yes? -> totally
fine as a method.

-Rob

Ian Booth (wallyworld) wrote :

>>
>> Bollocks. The Windmill layers need work to support this since they set
>> their base_url at class instantiation time. I need to go and add setUp()
>> methods to these layers.
>
> Heh, if its hard, don't bother in this landing, just iterate on it.
>

Already done. Doing local testing now.

> Re the helper methods.
>

<snip>

I'll rework some of the implementation aspects and get back to you.

Ian Booth (wallyworld) wrote :

I cleaned up the implementation and added the appserver_root_url method to the BaseLayer. Some of the implementation did have some dumb things in there, carried over from the doc test changes. I was clearly too close to the code by that point and needed to step back a little. It looks a lot nicer now.

The layer setup initialises the appserver_config_name variable so what's there should be compatible straight away with the parallel testing work.

review: Resubmit
Robert Collins (lifeless) wrote :

Thank you for experimenting there, yes it does look nicer.

Might like to change
# Set the default config name.
to
# Set the default appserver config instance name.

(Because its not the 'default config name' :).

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/canonical/config/__init__.py'
2--- lib/canonical/config/__init__.py 2010-05-26 10:42:10 +0000
3+++ lib/canonical/config/__init__.py 2010-10-20 05:19:46 +0000
4@@ -56,8 +56,7 @@
5 # The directories containing instances configuration directories.
6 CONFIG_ROOT_DIRS = [
7 os.path.join(TREE_ROOT, 'configs'),
8- os.path.join(TREE_ROOT, 'production-configs')
9- ]
10+ os.path.join(TREE_ROOT, 'production-configs')]
11
12
13 def find_instance_name():
14@@ -98,6 +97,7 @@
15 is thread safe (not that this will be a problem if we stick with
16 simple configuration).
17 """
18+
19 def __init__(self, instance_name=None, process_name=None):
20 """Create a new instance of CanonicalConfig.
21
22@@ -239,6 +239,15 @@
23 </configure>""" % self.config_dir
24 loader.close()
25
26+ def appserver_root_url(self, facet='mainsite', ensureSlash=False):
27+ """Return the correct app server root url for the given facet."""
28+ root_url = str(getattr(self.vhost, facet).rooturl)
29+ if not ensureSlash:
30+ return root_url.rstrip('/')
31+ if not root_url.endswith('/'):
32+ return root_url+'/'
33+ return root_url
34+
35 def __getattr__(self, name):
36 self._getConfig()
37 # Check first if it's not one of the name added directly
38@@ -277,6 +286,7 @@
39 value = urlunparse(bits)
40 return value
41
42+
43 def urlbase(value):
44 """ZConfig validator for url bases
45
46
47=== modified file 'lib/canonical/launchpad/doc/launchpadlib.txt'
48--- lib/canonical/launchpad/doc/launchpadlib.txt 2009-10-22 13:02:12 +0000
49+++ lib/canonical/launchpad/doc/launchpadlib.txt 2010-10-20 05:19:46 +0000
50@@ -4,20 +4,26 @@
51 if a specific user exists...
52
53 >>> browser = Browser('foo.bar@canonical.com:test')
54- >>> browser.open('http://launchpad.dev:8085/')
55- >>> browser.url
56- 'http://launchpad.dev:8085/'
57+ >>> from canonical.testing.layers import BaseLayer
58+ >>> root_url = BaseLayer.appserver_root_url()
59+ >>> browser.open(root_url)
60+ >>> browser.vhost
61+ 'http://launchpad.dev'
62+ >>> browser.urlpath
63+ '/'
64
65- >>> browser.open('http://launchpad.dev:8085/~stimpy')
66+ >>> browser.open('%s/~stimpy' % root_url)
67 Traceback (most recent call last):
68 ...
69 HTTPError: HTTP Error 404: Not Found
70
71 ...and when he doesn't, create him.
72
73- >>> browser.open('http://launchpad.dev:8085/people/+newteam')
74+ >>> browser.open('%s/people/+newteam' % root_url)
75 >>> browser.getControl(name='field.name').value = 'stimpy'
76 >>> browser.getControl('Display Name').value = 'Stimpson J. Cat'
77 >>> browser.getControl('Create').click()
78- >>> browser.url
79- 'http://launchpad.dev:8085/~stimpy'
80+ >>> browser.vhost
81+ 'http://launchpad.dev'
82+ >>> browser.urlpath
83+ '/~stimpy'
84
85=== modified file 'lib/canonical/launchpad/testing/browser.py'
86--- lib/canonical/launchpad/testing/browser.py 2010-08-20 20:31:18 +0000
87+++ lib/canonical/launchpad/testing/browser.py 2010-10-20 05:19:46 +0000
88@@ -14,6 +14,7 @@
89 latter prevents open socket leaks even when the doctest doesn't explicitly
90 close or delete the browser instance.
91 """
92+from lazr.uri._uri import URI
93
94 __metaclass__ = type
95 __all__ = [
96@@ -121,6 +122,21 @@
97 raise
98 self._stop_timer()
99
100+ @property
101+ def vhost(self):
102+ uri = URI(self.url)
103+ return '%s://%s' % (uri.scheme, uri.host)
104+
105+ @property
106+ def rooturl(self):
107+ uri = URI(self.url)
108+ return '%s://%s:%s' % (uri.scheme, uri.host, uri.port)
109+
110+ @property
111+ def urlpath(self):
112+ uri = URI(self.url)
113+ return uri.path
114+
115
116 def setUp(test):
117 """Set up appserver tests."""
118
119=== modified file 'lib/canonical/launchpad/webapp/tests/cookie-authentication.txt'
120--- lib/canonical/launchpad/webapp/tests/cookie-authentication.txt 2010-08-16 11:36:08 +0000
121+++ lib/canonical/launchpad/webapp/tests/cookie-authentication.txt 2010-10-20 05:19:46 +0000
122@@ -2,16 +2,21 @@
123 on http instead of https, it cannot read the secure cookie on https,
124 so it cannot tell that it will end up overwriting the existing cookie.
125
126- >>> browser.open('http://feeds.launchpad.dev:8085/announcements.atom')
127- >>> browser.url
128- 'http://feeds.launchpad.dev:8085/announcements.atom'
129+ >>> from canonical.testing.layers import BaseLayer
130+ >>> feeds_root_url = BaseLayer.appserver_root_url('feeds')
131+ >>> browser.open('%s/announcements.atom' % feeds_root_url)
132+ >>> browser.vhost
133+ 'http://feeds.launchpad.dev'
134+ >>> browser.urlpath
135+ '/announcements.atom'
136 >>> len(browser.cookies)
137 0
138
139 Our cookies need to have their domain attribute set to ensure that they
140 are sent to other vhosts in the same domain.
141
142- >>> browser.open('http://blueprints.launchpad.dev:8085/+login')
143+ >>> blueprints_root_url = BaseLayer.appserver_root_url('blueprints')
144+ >>> browser.open('%s/+login' % blueprints_root_url)
145
146 # On a browser with JS support, this page would've been automatically
147 # submitted (thanks to the onload handler), but testbrowser doesn't support
148@@ -28,7 +33,7 @@
149
150 # Open a page again so that we see the cookie for a launchpad.dev request
151 # and not a testopenid.dev request (as above).
152- >>> browser.open('http://blueprints.launchpad.dev:8085')
153+ >>> browser.open(blueprints_root_url)
154 >>> len(browser.cookies)
155 1
156 >>> browser.cookies.keys()
157@@ -39,9 +44,12 @@
158
159 If we visit another vhost in the domain, we remain logged in.
160
161- >>> browser.open('http://launchpad.dev:8085/')
162- >>> browser.url
163- 'http://launchpad.dev:8085/'
164+ >>> root_url = BaseLayer.appserver_root_url()
165+ >>> browser.open(root_url)
166+ >>> browser.vhost
167+ 'http://launchpad.dev'
168+ >>> browser.urlpath
169+ '/'
170 >>> print extract_text(find_tag_by_id(browser.contents, 'logincontrol'))
171 name16...
172 >>> browser.cookies.getinfo(session_cookie_name)['domain']
173@@ -49,9 +57,11 @@
174
175 Even if the browser passes in a cookie, the feeds vhost should not set one.
176
177- >>> browser.open('http://feeds.launchpad.dev:8085/announcements.atom')
178- >>> browser.url
179- 'http://feeds.launchpad.dev:8085/announcements.atom'
180+ >>> browser.open('%s/announcements.atom' % feeds_root_url)
181+ >>> browser.vhost
182+ 'http://feeds.launchpad.dev'
183+ >>> browser.urlpath
184+ '/announcements.atom'
185 >>> print browser.headers.get('Set-Cookie')
186 None
187
188
189=== modified file 'lib/canonical/launchpad/webapp/tests/login.txt'
190--- lib/canonical/launchpad/webapp/tests/login.txt 2010-02-25 10:50:31 +0000
191+++ lib/canonical/launchpad/webapp/tests/login.txt 2010-10-20 05:19:46 +0000
192@@ -8,10 +8,12 @@
193
194 # Set handleErrors to True so that the Unauthorized exception is handled
195 # by the publisher and we get redirected to the +login page.
196+ >>> from canonical.testing.layers import BaseLayer
197+ >>> root_url = BaseLayer.appserver_root_url()
198 >>> browser = Browser()
199 >>> browser.handleErrors = True
200 >>> browser.open(
201- ... 'http://launchpad.dev:8085/people/?name=foo&searchfor=all')
202+ ... '%s/people/?name=foo&searchfor=all' % root_url)
203 >>> browser.getLink('Log in / Register').click()
204
205 # On a browser with JS support, this page would've been automatically
206@@ -32,16 +34,17 @@
207 Once authenticated, we're redirected back to the page where we started, with
208 the query args preserved.
209
210- >>> url = browser.url
211- >>> print url
212- http://launchpad.dev:8085/people?...
213+ >>> browser.vhost
214+ 'http://launchpad.dev'
215+ >>> browser.urlpath
216+ '/people'
217 >>> import re
218- >>> print sorted(re.sub('.*\?', '', url).split('&'))
219+ >>> print sorted(re.sub('.*\?', '', browser.url).split('&'))
220 ['name=foo', 'searchfor=all']
221
222 If we load the +login page while already logged in, it will say we're already
223 logged in and ask us to log out if we're somebody else.
224
225- >>> browser.open('http://launchpad.dev:8085/+login')
226+ >>> browser.open('%s/+login' % root_url)
227 >>> print extract_text(find_main_content(browser.contents))
228 You are already logged in...
229
230=== modified file 'lib/canonical/launchpad/webapp/tests/no-anonymous-session-cookies.txt'
231--- lib/canonical/launchpad/webapp/tests/no-anonymous-session-cookies.txt 2010-08-13 10:06:42 +0000
232+++ lib/canonical/launchpad/webapp/tests/no-anonymous-session-cookies.txt 2010-10-20 05:19:46 +0000
233@@ -5,7 +5,9 @@
234
235 When we go to launchpad as an anonymous user, the browser has no cookies.
236
237- >>> browser.open('http://launchpad.dev:8085')
238+ >>> from canonical.testing.layers import BaseLayer
239+ >>> root_url = BaseLayer.appserver_root_url()
240+ >>> browser.open(root_url)
241 >>> len(browser.cookies)
242 0
243
244@@ -16,7 +18,7 @@
245 >>> now = datetime.datetime.now(pytz.UTC).replace(microsecond=0)
246 >>> year_from_now = now + datetime.timedelta(days=365)
247 >>> year_plus_from_now = year_from_now + datetime.timedelta(minutes=1)
248- >>> browser.open('http://launchpad.dev:8085/+login')
249+ >>> browser.open('%s/+login' % root_url)
250
251 # On a browser with JS support, this page would've been automatically
252 # submitted (thanks to the onload handler), but testbrowser doesn't support
253@@ -33,7 +35,7 @@
254
255 # Open a page again so that we see the cookie for a launchpad.dev request
256 # and not a testopenid.dev request (as above).
257- >>> browser.open('http://launchpad.dev:8085')
258+ >>> browser.open(root_url)
259
260 >>> len(browser.cookies)
261 1
262@@ -61,7 +63,7 @@
263 After ensuring the browser has not left the launchpad.dev domain, the
264 single cookie is shown to have the ten minute expiration.
265
266- >>> browser.open('http://launchpad.dev:8085')
267+ >>> browser.open(root_url)
268 >>> len(browser.cookies)
269 1
270 >>> expires = browser.cookies.getinfo('launchpad_tests')['expires']
271
272=== modified file 'lib/canonical/launchpad/webapp/tests/test_login.py'
273--- lib/canonical/launchpad/webapp/tests/test_login.py 2010-09-03 11:10:09 +0000
274+++ lib/canonical/launchpad/webapp/tests/test_login.py 2010-10-20 05:19:46 +0000
275@@ -549,7 +549,7 @@
276
277 def test_replay_attacks_do_not_succeed(self):
278 browser = Browser(mech_browser=MyMechanizeBrowser())
279- browser.open('http://launchpad.dev:8085/+login')
280+ browser.open('%s/+login' % self.layer.appserver_root_url())
281 # On a JS-enabled browser this page would've been auto-submitted
282 # (thanks to the onload handler), but here we have to do it manually.
283 self.assertIn('body onload', browser.contents)
284@@ -650,20 +650,21 @@
285
286 def test_realm_for_mainsite(self):
287 browser = Browser()
288- browser.open('http://launchpad.dev:8085/+login')
289+ browser.open('%s/+login' % self.layer.appserver_root_url())
290 # At this point browser.contents contains a hidden form which would've
291 # been auto-submitted if we had in-browser JS support, but since we
292 # don't we can easily inspect what's in the form.
293- self.assertEquals('http://launchpad.dev:8085/',
294+ self.assertEquals('%s/' % browser.rooturl,
295 browser.getControl(name='openid.realm').value)
296
297 def test_realm_for_vhosts(self):
298 browser = Browser()
299- browser.open('http://bugs.launchpad.dev:8085/+login')
300+ browser.open('%s/+login' % self.layer.appserver_root_url('bugs'))
301 # At this point browser.contents contains a hidden form which would've
302 # been auto-submitted if we had in-browser JS support, but since we
303 # don't we can easily inspect what's in the form.
304- self.assertEquals('http://launchpad.dev:8085/',
305+ self.assertEquals('%s'
306+ % self.layer.appserver_root_url(ensureSlash=True),
307 browser.getControl(name='openid.realm').value)
308
309
310
311=== modified file 'lib/canonical/testing/__init__.py'
312--- lib/canonical/testing/__init__.py 2010-05-06 15:36:19 +0000
313+++ lib/canonical/testing/__init__.py 2010-10-20 05:19:46 +0000
314@@ -64,6 +64,7 @@
315 Logging(Runner()).global_setup()
316
317
318+
319 # This import registers the 'doctest' Unicode codec.
320 import canonical.testing.doctestcodec
321
322
323=== modified file 'lib/canonical/testing/layers.py'
324--- lib/canonical/testing/layers.py 2010-10-17 05:02:20 +0000
325+++ lib/canonical/testing/layers.py 2010-10-20 05:19:46 +0000
326@@ -256,6 +256,9 @@
327 @classmethod
328 @profiled
329 def setUp(cls):
330+ # Set the default appserver config instance name.
331+ # May be changed as required eg when running parallel tests.
332+ cls.appserver_config_name = 'testrunner-appserver'
333 BaseLayer.isSetUp = True
334 BaseLayer.persist_test_services = (
335 os.environ.get('LP_PERSISTENT_TEST_SERVICES') is not None)
336@@ -469,6 +472,17 @@
337 finally:
338 del frame # As per no-leak stack inspection in Python reference.
339
340+ @classmethod
341+ def appserver_config(cls):
342+ """Return a config suitable for AppServer tests."""
343+ return CanonicalConfig(cls.appserver_config_name)
344+
345+ @classmethod
346+ def appserver_root_url(cls, facet='mainsite', ensureSlash=False):
347+ """Return the correct app server root url for the given facet."""
348+ return cls.appserver_config().appserver_root_url(
349+ facet, ensureSlash)
350+
351
352 class MemcachedLayer(BaseLayer):
353 """Provides tests access to a memcached.
354@@ -1932,15 +1946,10 @@
355
356 # Patch the config to provide the port number and not use https.
357 sites = (
358- ('vhost.mainsite', 'rooturl: http://launchpad.dev:8085/'),
359- ('vhost.answers', 'rooturl: http://answers.launchpad.dev:8085/'),
360- ('vhost.blueprints',
361- 'rooturl: http://blueprints.launchpad.dev:8085/'),
362- ('vhost.bugs', 'rooturl: http://bugs.launchpad.dev:8085/'),
363- ('vhost.code', 'rooturl: http://code.launchpad.dev:8085/'),
364- ('vhost.testopenid', 'rooturl: http://testopenid.dev:8085/'),
365- ('vhost.translations',
366- 'rooturl: http://translations.launchpad.dev:8085/'))
367+ (('vhost.%s' % sitename,
368+ 'rooturl: %s/' % cls.appserver_root_url(sitename))
369+ for sitename in ['mainsite', 'answers', 'blueprints', 'bugs',
370+ 'code', 'testopenid', 'translations']))
371 for site in sites:
372 config.push('windmillsettings', "\n[%s]\n%s\n" % site)
373 allvhosts.reload()
374@@ -2011,7 +2020,7 @@
375 # driver from out here.
376 config_text = dedent("""\
377 START_FIREFOX = True
378- TEST_URL = '%s'
379+ TEST_URL = '%s/'
380 CONSOLE_LOG_LEVEL = %d
381 """ % (cls.base_url, logging.NOTSET))
382 cls.config_file = tempfile.NamedTemporaryFile(suffix='.py')
383
384=== modified file 'lib/lp/bugs/windmill/testing.py'
385--- lib/lp/bugs/windmill/testing.py 2009-09-15 08:58:30 +0000
386+++ lib/lp/bugs/windmill/testing.py 2010-10-20 05:19:46 +0000
387@@ -15,4 +15,8 @@
388 class BugsWindmillLayer(BaseWindmillLayer):
389 """Layer for Bugs Windmill tests."""
390
391- base_url = 'http://bugs.launchpad.dev:8085/'
392+ @classmethod
393+ def setUp(cls):
394+ cls.base_url = cls.appserver_root_url('bugs')
395+ super(BugsWindmillLayer, cls).setUp()
396+
397
398=== modified file 'lib/lp/bugs/windmill/tests/test_bug_also_affects_new_upstream.py'
399--- lib/lp/bugs/windmill/tests/test_bug_also_affects_new_upstream.py 2010-08-20 20:31:18 +0000
400+++ lib/lp/bugs/windmill/tests/test_bug_also_affects_new_upstream.py 2010-10-20 05:19:46 +0000
401@@ -15,21 +15,27 @@
402 from lp.testing import WindmillTestCase
403
404
405-CHOOSE_AFFECTED_URL = ('http://bugs.launchpad.dev:8085/tomcat/+bug/3/'
406- '+choose-affected-product')
407-
408 class TestBugAlsoAffects(WindmillTestCase):
409
410 layer = BugsWindmillLayer
411 suite_name = 'test_bug_also_affects_register_link'
412
413- test_bug_also_affects_picker = FormPickerWidgetTest(
414- name='test_bug_also_affects',
415- url=CHOOSE_AFFECTED_URL,
416- short_field_name='product',
417- search_text='firefox',
418- result_index=1,
419- new_value='firefox')
420+ def setUp(self):
421+ WindmillTestCase.setUp(self)
422+ lpuser.SAMPLE_PERSON.ensure_login(self.client)
423+ self.choose_affected_url = (
424+ '%s/tomcat/+bug/3/+choose-affected-product'
425+ % BugsWindmillLayer.base_url)
426+
427+ def test_bug_also_affects_picker(self):
428+ test_bug_also_affects_picker = FormPickerWidgetTest(
429+ name='test_bug_also_affects',
430+ url=self.choose_affected_url,
431+ short_field_name='product',
432+ search_text='firefox',
433+ result_index=1,
434+ new_value='firefox')
435+ test_bug_also_affects_picker()
436
437 def test_bug_also_affects_register_link(self):
438 """Test that picker shows "Register it" link.
439@@ -44,9 +50,8 @@
440 client = self.client
441
442 # Open a bug page and wait for it to finish loading.
443- client.open(url=CHOOSE_AFFECTED_URL)
444+ client.open(url=self.choose_affected_url)
445 client.waits.forPageLoad(timeout=constants.PAGE_LOAD)
446- lpuser.SAMPLE_PERSON.ensure_login(client)
447
448 client.waits.forElement(
449 id=choose_link_id, timeout=constants.FOR_ELEMENT)
450@@ -55,5 +60,6 @@
451 client.waits.forElement(
452 link=u'Register it', timeout=constants.FOR_ELEMENT)
453
454+
455 def test_suite():
456 return unittest.TestLoader().loadTestsFromName(__name__)
457
458=== modified file 'lib/lp/bugs/windmill/tests/test_bug_commenting.py'
459--- lib/lp/bugs/windmill/tests/test_bug_commenting.py 2010-08-20 20:31:18 +0000
460+++ lib/lp/bugs/windmill/tests/test_bug_commenting.py 2010-10-20 05:19:46 +0000
461@@ -31,7 +31,7 @@
462 client = self.client
463 lpuser.NO_PRIV.ensure_login(client)
464
465- client.open(url='http://bugs.launchpad.dev:8085/bugs/1')
466+ client.open(url='%s/bugs/1' % BugsWindmillLayer.base_url)
467 client.waits.forPageLoad(timeout=WAIT_PAGELOAD)
468 client.waits.forElement(xpath=ADD_COMMENT_BUTTON)
469
470
471=== modified file 'lib/lp/bugs/windmill/tests/test_bug_inline_subscriber.py'
472--- lib/lp/bugs/windmill/tests/test_bug_inline_subscriber.py 2010-08-20 20:31:18 +0000
473+++ lib/lp/bugs/windmill/tests/test_bug_inline_subscriber.py 2010-10-20 05:19:46 +0000
474@@ -13,10 +13,10 @@
475 from lp.testing import WindmillTestCase
476
477
478-BUG_URL = u'http://bugs.launchpad.dev:8085/bugs/%s'
479 SUBSCRIPTION_LINK = u'//div[@id="portlet-subscribers"]/div/div/a'
480 PERSON_LINK = u'//div[@id="subscribers-links"]/div/a[@name="%s"]'
481
482+
483 class TestInlineSubscribing(WindmillTestCase):
484
485 layer = BugsWindmillLayer
486@@ -31,8 +31,9 @@
487 """
488 client = self.client
489
490+ bug_url = u'%s/bugs/%%s' % BugsWindmillLayer.base_url
491 # Open a bug page and wait for it to finish loading.
492- client.open(url=BUG_URL % 11)
493+ client.open(url=bug_url % 11)
494 client.waits.forPageLoad(timeout=PAGE_LOAD)
495 lpuser.SAMPLE_PERSON.ensure_login(client)
496
497@@ -142,7 +143,7 @@
498
499 # Test unsubscribing via the remove icon for duplicates.
500 # First, go to bug 6 and subscribe.
501- client.open(url=BUG_URL % 6)
502+ client.open(url=bug_url % 6)
503 client.waits.forPageLoad(timeout=PAGE_LOAD)
504 client.waits.forElement(
505 id=u'subscribers-links', timeout=FOR_ELEMENT)
506@@ -152,7 +153,7 @@
507 xpath=SUBSCRIPTION_LINK, validator=u'Unsubscribe')
508 client.asserts.assertNode(xpath=PERSON_LINK % u'Foo Bar')
509 # Bug 6 is a dupe of bug 5, so go to bug 5 to unsubscribe.
510- client.open(url=BUG_URL % 5)
511+ client.open(url=bug_url % 5)
512 client.waits.forPageLoad(timeout=PAGE_LOAD)
513 client.waits.forElement(
514 id=u'subscribers-links', timeout=FOR_ELEMENT)
515@@ -162,7 +163,7 @@
516 xpath=SUBSCRIPTION_LINK, validator=u'Subscribe')
517 client.asserts.assertNotNode(xpath=PERSON_LINK % u'Foo Bar')
518 # Then back to bug 6 to confirm the duplicate is also unsubscribed.
519- client.open(url=BUG_URL % 6)
520+ client.open(url=bug_url % 6)
521 client.waits.forPageLoad(timeout=PAGE_LOAD)
522 client.waits.forElement(
523 id=u'subscribers-links', timeout=FOR_ELEMENT)
524@@ -177,7 +178,7 @@
525 # dealing with a duplicate and an indirect subscription.
526 lpuser.SAMPLE_PERSON.ensure_login(client)
527 # Go to bug 6, the dupe, and subscribe.
528- client.open(url=BUG_URL % 6)
529+ client.open(url=bug_url % 6)
530 client.waits.forPageLoad(timeout=PAGE_LOAD)
531 client.waits.forElement(
532 id=u'subscribers-links', timeout=FOR_ELEMENT)
533@@ -186,7 +187,7 @@
534 client.asserts.assertText(
535 xpath=SUBSCRIPTION_LINK, validator=u'Unsubscribe')
536 # Now back to bug 5.
537- client.open(url=BUG_URL % 5)
538+ client.open(url=bug_url % 5)
539 client.waits.forPageLoad(timeout=PAGE_LOAD)
540 client.waits.forElement(
541 id=u'subscribers-links', timeout=FOR_ELEMENT)
542@@ -216,7 +217,7 @@
543 client.asserts.assertText(
544 xpath=SUBSCRIPTION_LINK, validator=u'Unsubscribe')
545 # Go to bug 6, the dupe, and subscribe.
546- client.open(url=BUG_URL % 6)
547+ client.open(url=bug_url % 6)
548 client.waits.forPageLoad(timeout=PAGE_LOAD)
549 client.waits.forElement(
550 id=u'subscribers-links', timeout=FOR_ELEMENT)
551@@ -225,7 +226,7 @@
552 client.asserts.assertText(
553 xpath=SUBSCRIPTION_LINK, validator=u'Unsubscribe')
554 # Now back to bug 5. Confirm there are 2 subscriptions.
555- client.open(url=BUG_URL % 5)
556+ client.open(url=bug_url % 5)
557 client.waits.forPageLoad(timeout=PAGE_LOAD)
558 client.asserts.assertNode(
559 id='direct-subscriber-12', timeout=FOR_ELEMENT)
560@@ -246,5 +247,6 @@
561 xpath=(u'//div[@id="subscribers-from-duplicates"]'
562 '/div/a[@name="Sample Person"]'))
563
564+
565 def test_suite():
566 return unittest.TestLoader().loadTestsFromName(__name__)
567
568=== modified file 'lib/lp/bugs/windmill/tests/test_bug_me_too.py'
569--- lib/lp/bugs/windmill/tests/test_bug_me_too.py 2010-08-20 20:31:18 +0000
570+++ lib/lp/bugs/windmill/tests/test_bug_me_too.py 2010-10-20 05:19:46 +0000
571@@ -57,7 +57,7 @@
572
573 # Open bug 11 and wait for it to finish loading.
574 client.open(
575- url=u'http://bugs.launchpad.dev:8085/jokosher/+bug/11/+index')
576+ url=u'%s/jokosher/+bug/11/+index' % BugsWindmillLayer.base_url)
577 client.waits.forPageLoad(timeout=constants.PAGE_LOAD)
578 lpuser.SAMPLE_PERSON.ensure_login(client)
579
580
581=== modified file 'lib/lp/bugs/windmill/tests/test_bug_privacy_settings.py'
582--- lib/lp/bugs/windmill/tests/test_bug_privacy_settings.py 2010-08-20 20:31:18 +0000
583+++ lib/lp/bugs/windmill/tests/test_bug_privacy_settings.py 2010-10-20 05:19:46 +0000
584@@ -11,7 +11,6 @@
585 from lp.testing import WindmillTestCase
586
587
588-BUG_URL = u'http://bugs.launchpad.dev:8085/bugs/15'
589 MAIN_FORM_ELEMENT = u'//div[@id="privacy-form-container"]/div'
590 FORM_NOT_VISIBLE = (
591 u'element.className.search("yui-lazr-formoverlay-hidden") != -1')
592@@ -50,8 +49,9 @@
593 """
594 client = self.client
595
596+ bug_url = u'%s/bugs/15' % BugsWindmillLayer.base_url
597 # Open a bug page and wait for it to finish loading.
598- client.open(url=BUG_URL)
599+ client.open(url=bug_url)
600 client.waits.forPageLoad(timeout=constants.PAGE_LOAD)
601 lpuser.SAMPLE_PERSON.ensure_login(client)
602
603@@ -99,7 +99,7 @@
604 # we get the same text in the HTML data sent by the server,
605 # so that we can be sure that the security settings are correctly
606 # updated.
607- client.open(url=BUG_URL)
608+ client.open(url=bug_url)
609 client.waits.forPageLoad(timeout=constants.PAGE_LOAD)
610 client.waits.forElement(
611 xpath=MAIN_FORM_ELEMENT, timeout=constants.FOR_ELEMENT)
612@@ -137,7 +137,7 @@
613 client.asserts.assertChecked(id=FIELD_SECURITY_RELATED)
614
615 # When we reload the page, we get the same texts.
616- client.open(url=BUG_URL)
617+ client.open(url=bug_url)
618 client.waits.forPageLoad(timeout=constants.PAGE_LOAD)
619 client.waits.forElement(
620 xpath=MAIN_FORM_ELEMENT, timeout=constants.FOR_ELEMENT)
621@@ -157,7 +157,7 @@
622
623 # When we reload the page, the <div> for the security message
624 # does not exist either.
625- client.open(url=BUG_URL)
626+ client.open(url=bug_url)
627 client.waits.forPageLoad(timeout=constants.PAGE_LOAD)
628 client.waits.forElement(
629 xpath=MAIN_FORM_ELEMENT, timeout=constants.FOR_ELEMENT)
630@@ -176,5 +176,6 @@
631 client.asserts.assertElemJS(
632 xpath=MAIN_FORM_ELEMENT, js=FORM_NOT_VISIBLE)
633
634+
635 def test_suite():
636 return unittest.TestLoader().loadTestsFromName(__name__)
637
638=== modified file 'lib/lp/bugs/windmill/tests/test_filebug_dupe_finder.py'
639--- lib/lp/bugs/windmill/tests/test_filebug_dupe_finder.py 2010-08-20 20:31:18 +0000
640+++ lib/lp/bugs/windmill/tests/test_filebug_dupe_finder.py 2010-10-20 05:19:46 +0000
641@@ -11,8 +11,6 @@
642 from lp.testing import WindmillTestCase
643
644
645-FILEBUG_URL = 'http://bugs.launchpad.dev:8085/firefox/+filebug'
646-
647 FORM_OVERLAY = u'//div[@id="duplicate-overlay-bug-4"]/div'
648 FORM_OVERLAY_CANCEL = (
649 u'//div[@id="duplicate-overlay-bug-4"]'
650@@ -30,6 +28,7 @@
651 BUG_INFO_HIDDEN = 'style.height|0px'
652 BUG_INFO_SHOWN_JS = 'element.style.height != "0px"'
653
654+
655 class TestDupeFinder(WindmillTestCase):
656
657 layer = BugsWindmillLayer
658@@ -46,7 +45,7 @@
659 lpuser.SAMPLE_PERSON.ensure_login(client)
660
661 # Go to the +filebug page for Firefox
662- client.open(url=FILEBUG_URL)
663+ client.open(url=u'%s/firefox/+filebug' % BugsWindmillLayer.base_url)
664 client.waits.forPageLoad(timeout=constants.PAGE_LOAD)
665
666 # Ensure the "search" field has finished loading, then enter a simple
667@@ -119,5 +118,6 @@
668 xpath=u'//div[@class="message"]',
669 validator="Required input is missing.")
670
671+
672 def test_suite():
673 return unittest.TestLoader().loadTestsFromName(__name__)
674
675=== modified file 'lib/lp/bugs/windmill/tests/test_filebug_extra_options.py'
676--- lib/lp/bugs/windmill/tests/test_filebug_extra_options.py 2010-08-20 20:31:18 +0000
677+++ lib/lp/bugs/windmill/tests/test_filebug_extra_options.py 2010-10-20 05:19:46 +0000
678@@ -25,7 +25,7 @@
679 client = self.client
680
681 # Open a +filebug page and wait for it to finish loading.
682- client.open(url=u'http://bugs.launchpad.dev:8085/firefox/+filebug')
683+ client.open(url=u'%s/firefox/+filebug' % BugsWindmillLayer.base_url)
684 client.waits.forPageLoad(timeout=constants.PAGE_LOAD)
685 lpuser.SAMPLE_PERSON.ensure_login(client)
686
687
688=== modified file 'lib/lp/bugs/windmill/tests/test_mark_duplicate.py'
689--- lib/lp/bugs/windmill/tests/test_mark_duplicate.py 2010-08-20 20:31:18 +0000
690+++ lib/lp/bugs/windmill/tests/test_mark_duplicate.py 2010-10-20 05:19:46 +0000
691@@ -41,7 +41,7 @@
692 client = self.client
693
694 # Open a bug page and wait for it to finish loading
695- client.open(url=u'http://bugs.launchpad.dev:8085/bugs/15')
696+ client.open(url=u'%s/bugs/15' % BugsWindmillLayer.base_url)
697 client.waits.forPageLoad(timeout=constants.PAGE_LOAD)
698 lpuser.SAMPLE_PERSON.ensure_login(client)
699
700@@ -121,7 +121,7 @@
701 timeout=constants.FOR_ELEMENT)
702
703 # When we go back to the page for the duplicate bug...
704- client.open(url=u'http://bugs.launchpad.dev:8085/bugs/15')
705+ client.open(url=u'%s/bugs/15' % BugsWindmillLayer.base_url)
706 client.waits.forPageLoad(timeout=constants.PAGE_LOAD)
707 client.waits.forElement(
708 xpath=MAIN_FORM_ELEMENT, timeout=constants.FOR_ELEMENT)
709
710=== modified file 'lib/lp/bugs/windmill/tests/test_official_bug_tags_management.py'
711--- lib/lp/bugs/windmill/tests/test_official_bug_tags_management.py 2010-08-20 20:31:18 +0000
712+++ lib/lp/bugs/windmill/tests/test_official_bug_tags_management.py 2010-10-20 05:19:46 +0000
713@@ -27,7 +27,7 @@
714
715 # Firefox is a product - an official bug tags target.
716
717- client.open(url='http://bugs.launchpad.dev:8085/firefox')
718+ client.open(url='%s/firefox' % BugsWindmillLayer.base_url)
719 client.waits.forPageLoad(timeout=constants.PAGE_LOAD)
720 lpuser.FOO_BAR.ensure_login(client)
721
722
723=== modified file 'lib/lp/code/model/tests/test_sourcepackagerecipe.py'
724--- lib/lp/code/model/tests/test_sourcepackagerecipe.py 2010-09-22 21:03:48 +0000
725+++ lib/lp/code/model/tests/test_sourcepackagerecipe.py 2010-10-20 05:19:46 +0000
726@@ -732,7 +732,7 @@
727 db_archive = self.factory.makeArchive(owner=owner, name="recipe-ppa")
728 transaction.commit()
729 launchpad = launchpadlib_for('test', user,
730- service_root="http://api.launchpad.dev:8085")
731+ service_root=self.layer.appserver_root_url('api'))
732 login(ANONYMOUS)
733 distroseries = ws_object(launchpad, db_distroseries)
734 ws_owner = ws_object(launchpad, owner)
735
736=== modified file 'lib/lp/code/windmill/testing.py'
737--- lib/lp/code/windmill/testing.py 2010-01-13 23:13:21 +0000
738+++ lib/lp/code/windmill/testing.py 2010-10-20 05:19:46 +0000
739@@ -15,4 +15,8 @@
740 class CodeWindmillLayer(BaseWindmillLayer):
741 """Layer for Code Windmill tests."""
742
743- base_url = 'http://code.launchpad.dev:8085/'
744+ @classmethod
745+ def setUp(cls):
746+ cls.base_url = cls.appserver_root_url('code')
747+ super(CodeWindmillLayer, cls).setUp()
748+
749
750=== modified file 'lib/lp/code/windmill/tests/test_branch_bugspeclinks.py'
751--- lib/lp/code/windmill/tests/test_branch_bugspeclinks.py 2010-02-01 18:37:00 +0000
752+++ lib/lp/code/windmill/tests/test_branch_bugspeclinks.py 2010-10-20 05:19:46 +0000
753@@ -43,7 +43,7 @@
754 lpuser.FOO_BAR.ensure_login(client)
755
756 start_url = (
757- windmill.settings['TEST_URL'] + '/~mark/firefox/release--0.9.1')
758+ windmill.settings['TEST_URL'] + '~mark/firefox/release--0.9.1')
759 client.open(url=start_url)
760 client.waits.forElement(id=u'linkbug', timeout=u'10000')
761
762
763=== modified file 'lib/lp/code/windmill/tests/test_branch_subscriptions.py'
764--- lib/lp/code/windmill/tests/test_branch_subscriptions.py 2010-08-20 20:31:18 +0000
765+++ lib/lp/code/windmill/tests/test_branch_subscriptions.py 2010-10-20 05:19:46 +0000
766@@ -29,7 +29,7 @@
767 lpuser.FOO_BAR.ensure_login(client)
768
769 client.open(url=(
770- windmill.settings['TEST_URL'] + '/~mark/firefox/release--0.9.1'))
771+ windmill.settings['TEST_URL'] + '~mark/firefox/release--0.9.1'))
772 client.waits.forElement(id=u'none-subscribers', timeout=u'10000')
773 client.asserts.assertText(
774 xpath=u'//a[@class="sprite add subscribe-self js-action"]',
775@@ -66,7 +66,7 @@
776
777 client.open(url=''.join([
778 windmill.settings['TEST_URL'],
779- '/~name12/landscape/feature-x/']))
780+ '~name12/landscape/feature-x/']))
781 client.waits.forPageLoad(timeout=u'10000')
782
783 client.waits.forElement(
784
785=== modified file 'lib/lp/code/windmill/tests/test_branchmergeproposal_review.py'
786--- lib/lp/code/windmill/tests/test_branchmergeproposal_review.py 2010-08-20 20:31:18 +0000
787+++ lib/lp/code/windmill/tests/test_branchmergeproposal_review.py 2010-10-20 05:19:46 +0000
788@@ -45,7 +45,7 @@
789
790 client.open(url=''.join([
791 windmill.settings['TEST_URL'],
792- '/~name12/gnome-terminal/klingon/']))
793+ '~name12/gnome-terminal/klingon/']))
794 client.waits.forPageLoad(timeout=u'10000')
795
796 link = u'//a[@class="menu-link-register_merge sprite add"]'
797
798=== modified file 'lib/lp/code/windmill/tests/test_productseries_setbranch.py'
799--- lib/lp/code/windmill/tests/test_productseries_setbranch.py 2010-08-20 20:31:18 +0000
800+++ lib/lp/code/windmill/tests/test_productseries_setbranch.py 2010-10-20 05:19:46 +0000
801@@ -26,7 +26,7 @@
802 user = lpuser.FOO_BAR
803 user.ensure_login(self.client)
804 self.client.open(
805- url=u'http://launchpad.dev:8085/firefox/trunk/+setbranch')
806+ url=u'%s/firefox/trunk/+setbranch' % CodeWindmillLayer.base_url)
807
808 # To demonstrate the Javascript is loaded we simply need to see that
809 # one of the controls is deactivated when the radio button selections
810
811=== modified file 'lib/lp/registry/windmill/testing.py'
812--- lib/lp/registry/windmill/testing.py 2009-10-09 21:24:20 +0000
813+++ lib/lp/registry/windmill/testing.py 2010-10-20 05:19:46 +0000
814@@ -15,4 +15,8 @@
815 class RegistryWindmillLayer(BaseWindmillLayer):
816 """Layer for Registry Windmill tests."""
817
818- base_url = 'http://launchpad.dev:8085/'
819+ @classmethod
820+ def setUp(cls):
821+ cls.base_url = cls.appserver_root_url()
822+ super(RegistryWindmillLayer, cls).setUp()
823+
824
825=== modified file 'lib/lp/registry/windmill/tests/test_add_bugtracker.py'
826--- lib/lp/registry/windmill/tests/test_add_bugtracker.py 2010-08-20 20:31:18 +0000
827+++ lib/lp/registry/windmill/tests/test_add_bugtracker.py 2010-10-20 05:19:46 +0000
828@@ -91,7 +91,8 @@
829 def test_adding_bugtracker_for_project(self):
830 test_inline_add_bugtracker(
831 self.client,
832- url='http://launchpad.dev:8085/bzr/+configure-bugtracker',
833+ url='%s/bzr/+configure-bugtracker'
834+ % RegistryWindmillLayer.base_url,
835 name='test_inline_add_bugtracker_for_project')
836
837
838
839=== modified file 'lib/lp/registry/windmill/tests/test_add_milestone.py'
840--- lib/lp/registry/windmill/tests/test_add_milestone.py 2010-08-20 20:31:18 +0000
841+++ lib/lp/registry/windmill/tests/test_add_milestone.py 2010-10-20 05:19:46 +0000
842@@ -87,7 +87,7 @@
843 def test_adding_milestone_on_addrelease_page(self):
844 test_inline_add_milestone(
845 self.client,
846- url='http://launchpad.dev:8085/bzr/trunk/+addrelease',
847+ url='%s/bzr/trunk/+addrelease' % RegistryWindmillLayer.base_url,
848 name='test_inline_add_milestone_for_release')
849
850
851
852=== modified file 'lib/lp/registry/windmill/tests/test_datetime_picker.py'
853--- lib/lp/registry/windmill/tests/test_datetime_picker.py 2010-08-20 20:31:18 +0000
854+++ lib/lp/registry/windmill/tests/test_datetime_picker.py 2010-10-20 05:19:46 +0000
855@@ -31,7 +31,8 @@
856
857 # Open a new sprint page and wait for it to finish loading.
858 self.client.open(
859- url=u'http://blueprints.launchpad.dev:8085/sprints/+new')
860+ url=u'%s/sprints/+new'
861+ % self.layer.appserver_root_url('blueprints'))
862 self.client.waits.forPageLoad(timeout=u'20000')
863 self.client.waits.forElement(link=u'Choose...', timeout=u'8000')
864
865
866=== modified file 'lib/lp/registry/windmill/tests/test_person_picker.py'
867--- lib/lp/registry/windmill/tests/test_person_picker.py 2010-08-20 20:31:18 +0000
868+++ lib/lp/registry/windmill/tests/test_person_picker.py 2010-10-20 05:19:46 +0000
869@@ -30,7 +30,8 @@
870 client = self.client
871 lpuser.SAMPLE_PERSON.ensure_login(client)
872
873- client.open(url=u'http://launchpad.dev:8085/people/+requestmerge')
874+ client.open(url=u'%s/people/+requestmerge'
875+ % RegistryWindmillLayer.base_url)
876 client.waits.forPageLoad(timeout=constants.PAGE_LOAD)
877 client.waits.forElement(id=u'show-widget-field-dupe_person',
878 timeout=constants.FOR_ELEMENT)
879
880=== modified file 'lib/lp/registry/windmill/tests/test_plusnew_step1.py'
881--- lib/lp/registry/windmill/tests/test_plusnew_step1.py 2010-08-20 20:31:18 +0000
882+++ lib/lp/registry/windmill/tests/test_plusnew_step1.py 2010-10-20 05:19:46 +0000
883@@ -30,7 +30,8 @@
884 """
885 # Perform step 1 of the project registration, using information
886 # that will yield search results.
887- self.client.open(url=u'http://launchpad.dev:8085/projects/+new')
888+ self.client.open(url=u'%s/projects/+new'
889+ % RegistryWindmillLayer.base_url)
890
891 lpuser.SAMPLE_PERSON.ensure_login(self.client)
892
893
894=== modified file 'lib/lp/registry/windmill/tests/test_plusnew_step2.py'
895--- lib/lp/registry/windmill/tests/test_plusnew_step2.py 2010-08-20 20:31:18 +0000
896+++ lib/lp/registry/windmill/tests/test_plusnew_step2.py 2010-10-20 05:19:46 +0000
897@@ -32,7 +32,8 @@
898
899 # Perform step 1 of the project registration, using information
900 # that will yield search results.
901- self.client.open(url=u'http://launchpad.dev:8085/projects/+new')
902+ self.client.open(url=u'%s/projects/+new'
903+ % RegistryWindmillLayer.base_url)
904
905 lpuser.SAMPLE_PERSON.ensure_login(self.client)
906
907
908=== modified file 'lib/lp/registry/windmill/tests/test_product.py'
909--- lib/lp/registry/windmill/tests/test_product.py 2010-08-20 20:31:18 +0000
910+++ lib/lp/registry/windmill/tests/test_product.py 2010-10-20 05:19:46 +0000
911@@ -23,7 +23,7 @@
912
913 def test_title_inline_edit(self):
914 test = widgets.InlineEditorWidgetTest(
915- url='http://launchpad.dev:8085/firefox',
916+ url='%s/firefox' % RegistryWindmillLayer.base_url,
917 widget_id='product-title',
918 expected_value='Mozilla Firefox',
919 new_value='The awesome Mozilla Firefox',
920@@ -34,7 +34,7 @@
921
922 def test_programming_languages_edit(self):
923 test = widgets.InlineEditorWidgetTest(
924- url='http://launchpad.dev:8085/firefox',
925+ url='%s/firefox' % RegistryWindmillLayer.base_url,
926 widget_id='programminglang',
927 widget_tag='span',
928 expected_value='Not yet specified',
929
930=== modified file 'lib/lp/registry/windmill/tests/test_product_edit_people.py'
931--- lib/lp/registry/windmill/tests/test_product_edit_people.py 2010-08-20 20:31:18 +0000
932+++ lib/lp/registry/windmill/tests/test_product_edit_people.py 2010-10-20 05:19:46 +0000
933@@ -21,7 +21,7 @@
934 def test_product_edit_people_driver(self):
935 test = FormPickerWidgetTest(
936 name='test_product_edit_people_driver',
937- url='http://launchpad.dev:8085/firefox/+edit-people',
938+ url='%s/firefox/+edit-people' % RegistryWindmillLayer.base_url,
939 short_field_name='driver',
940 search_text='Perell\xc3\xb3',
941 result_index=1,
942@@ -31,7 +31,7 @@
943 def test_product_edit_people_owner(self):
944 test = FormPickerWidgetTest(
945 name='test_product_edit_people_owner',
946- url='http://launchpad.dev:8085/firefox/+edit-people',
947+ url='%s/firefox/+edit-people' % RegistryWindmillLayer.base_url,
948 short_field_name='owner',
949 search_text='guadamen',
950 result_index=1,
951
952=== modified file 'lib/lp/registry/windmill/tests/test_project_licenses.py'
953--- lib/lp/registry/windmill/tests/test_project_licenses.py 2010-08-26 23:51:10 +0000
954+++ lib/lp/registry/windmill/tests/test_project_licenses.py 2010-10-20 05:19:46 +0000
955@@ -23,7 +23,8 @@
956 """Test the dynamic aspects of the project license picker."""
957 # The firefox project is as good as any.
958 lpuser.SAMPLE_PERSON.ensure_login(self.client)
959- self.client.open(url=u'http://launchpad.dev:8085/firefox/+edit')
960+ self.client.open(url=u'%s/firefox/+edit'
961+ % RegistryWindmillLayer.base_url)
962 self.client.waits.forPageLoad(timeout=u'20000')
963
964 # The Recommended table is visible.
965@@ -126,7 +127,8 @@
966 self.client.click(id='field.actions.change')
967 self.client.waits.forPageLoad(timeout=u'20000')
968
969- self.client.open(url=u'http://launchpad.dev:8085/firefox/+edit')
970+ self.client.open(url=u'%s/firefox/+edit'
971+ % RegistryWindmillLayer.base_url)
972 self.client.waits.forPageLoad(timeout=u'20000')
973
974 self.client.asserts.assertProperty(
975
976=== modified file 'lib/lp/registry/windmill/tests/test_team_index.py'
977--- lib/lp/registry/windmill/tests/test_team_index.py 2010-08-20 20:31:18 +0000
978+++ lib/lp/registry/windmill/tests/test_team_index.py 2010-10-20 05:19:46 +0000
979@@ -24,7 +24,7 @@
980
981 def test_addmember(self):
982 self.client.open(
983- url=u'http://launchpad.dev:8085/~testing-spanish-team')
984+ url=u'%s/~testing-spanish-team' % RegistryWindmillLayer.base_url)
985
986 lpuser.TRANSLATIONS_ADMIN.ensure_login(self.client)
987
988
989=== modified file 'lib/lp/registry/windmill/tests/test_timeline_graph.py'
990--- lib/lp/registry/windmill/tests/test_timeline_graph.py 2010-02-01 18:37:00 +0000
991+++ lib/lp/registry/windmill/tests/test_timeline_graph.py 2010-10-20 05:19:46 +0000
992@@ -22,7 +22,8 @@
993 """Test timeline graph on /$project/+timeline-graph page."""
994
995 self.client.open(
996- url=u'http://launchpad.dev:8085/firefox/+timeline-graph')
997+ url=u'%s/firefox/+timeline-graph'
998+ % RegistryWindmillLayer.base_url)
999 self.client.waits.forElement(id=u'spinner', timeout=u'20000')
1000 self.client.waits.forElementProperty(
1001 id=u'spinner',
1002@@ -35,7 +36,7 @@
1003 def test_project_timeline_graph(self):
1004 """Test that the timeline graph loads on /$project page."""
1005
1006- self.client.open(url=u'http://launchpad.dev:8085/firefox')
1007+ self.client.open(url=u'%s/firefox' % RegistryWindmillLayer.base_url)
1008
1009 self.client.waits.forElementProperty(
1010 id=u'timeline-loading',
1011@@ -49,7 +50,8 @@
1012 def test_series_timeline_graph(self):
1013 """Test that the timeline graph loads on /$project/$series page."""
1014
1015- self.client.open(url=u'http://launchpad.dev:8085/firefox/trunk')
1016+ self.client.open(url=u'%s/firefox/trunk'
1017+ % RegistryWindmillLayer.base_url)
1018
1019 self.client.waits.forElementProperty(
1020 id=u'timeline-iframe',
1021@@ -64,7 +66,8 @@
1022 def test_all_series_timeline_graph(self):
1023 """Test that the timeline graph loads on /$project/+series page."""
1024
1025- self.client.open(url=u'http://launchpad.dev:8085/firefox/+series')
1026+ self.client.open(url=u'%s/firefox/+series'
1027+ % RegistryWindmillLayer.base_url)
1028
1029 self.client.waits.forElement(
1030 id=u'timeline-loading',
1031
1032=== modified file 'lib/lp/services/mailman/doc/contact-address.txt'
1033--- lib/lp/services/mailman/doc/contact-address.txt 2009-12-02 22:56:09 +0000
1034+++ lib/lp/services/mailman/doc/contact-address.txt 2010-10-20 05:19:46 +0000
1035@@ -22,8 +22,10 @@
1036
1037 >>> from canonical.launchpad.testing.pages import strip_label
1038
1039+ >>> from canonical.testing.layers import BaseLayer
1040+ >>> root_url = BaseLayer.appserver_root_url()
1041 >>> browser = Browser('no-priv@canonical.com:test')
1042- >>> browser.open('http://launchpad.dev:8085/~itest-one/+contactaddress')
1043+ >>> browser.open('%s/~itest-one/+contactaddress' % root_url)
1044 >>> browser.getControl('The Launchpad mailing list').selected = True
1045 >>> browser.getControl('Change').click()
1046
1047@@ -33,8 +35,9 @@
1048 >>> [strip_label(label) for label in control.displayValue]
1049 ['The Launchpad mailing list for this team...]
1050
1051+ >>> answers_url = BaseLayer.appserver_root_url('answers')
1052 >>> browser.open(
1053- ... 'http://answers.launchpad.dev:8085/firefox/+answer-contact')
1054+ ... '%s/firefox/+answer-contact' % answers_url)
1055 >>> browser.getControl(name='field.answer_contact_teams').displayValue = [
1056 ... 'Itest One']
1057 >>> browser.getControl('Continue').click()
1058@@ -42,7 +45,7 @@
1059 Now that the contact address for the team is its mailing list, a new questions
1060 will be delivered to the mailing list.
1061
1062- >>> browser.open('http://answers.launchpad.dev:8085/firefox/+addquestion')
1063+ >>> browser.open('%s/firefox/+addquestion' % answers_url)
1064 >>> browser.getControl('Summary').value = 'A new question'
1065 >>> browser.getControl('Continue').click()
1066 >>> browser.getControl('Description').value = 'More detail.'
1067@@ -86,7 +89,7 @@
1068 X-RcptTo: no-priv@canonical.com
1069 <BLANKLINE>
1070 New question #... on Mozilla Firefox:
1071- http://answers.launchpad.dev:8085/firefox/+question/...
1072+ http://answers.launchpad.dev:.../firefox/+question/...
1073 <BLANKLINE>
1074 More detail.
1075 <BLANKLINE>
1076@@ -125,7 +128,7 @@
1077 X-RcptTo: anne.person@example.com
1078 <BLANKLINE>
1079 New question #... on Mozilla Firefox:
1080- http://answers.launchpad.dev:8085/firefox/+question/...
1081+ http://answers.launchpad.dev:.../firefox/+question/...
1082 <BLANKLINE>
1083 More detail.
1084 <BLANKLINE>
1085@@ -154,7 +157,7 @@
1086 sent to Anne and to the archive, via the mailing list.
1087
1088 >>> browser.open(
1089- ... 'http://launchpad.dev:8085/firefox/+spec/canvas/+addsubscriber')
1090+ ... '%s/firefox/+spec/canvas/+addsubscriber' % root_url)
1091 >>> browser.getControl('Subscriber').value = 'itest-one'
1092 >>> browser.getControl('Continue').click()
1093
1094@@ -195,7 +198,7 @@
1095 Objects.
1096 <BLANKLINE>
1097 --
1098- http://blueprints.launchpad.dev:8085/firefox/+spec/canvas
1099+ http://blueprints.launchpad.dev:.../firefox/+spec/canvas
1100 _______________________________________________
1101 Mailing list: http://launchpad.dev/~itest-one
1102 Post to : itest-one@lists.launchpad.dev
1103@@ -222,7 +225,7 @@
1104 Objects.
1105 <BLANKLINE>
1106 --
1107- http://blueprints.launchpad.dev:8085/firefox/+spec/canvas
1108+ http://blueprints.launchpad.dev:.../firefox/+spec/canvas
1109 _______________________________________________
1110 Mailing list: http://launchpad.dev/~itest-one
1111 Post to : itest-one@lists.launchpad.dev
1112@@ -232,7 +235,7 @@
1113 The team's contact address is set to each team member individually.
1114 Notifications will no longer be sent to the mailing list.
1115
1116- >>> browser.open('http://launchpad.dev:8085/~itest-one/+contactaddress')
1117+ >>> browser.open('%s/~itest-one/+contactaddress' % root_url)
1118 >>> browser.getControl('Each member individually').selected = True
1119 >>> browser.getControl('Change').click()
1120
1121@@ -242,7 +245,7 @@
1122 >>> [strip_label(label) for label in control.displayValue]
1123 ['Each member individually']
1124
1125- >>> browser.open('http://answers.launchpad.dev:8085/firefox/+addquestion')
1126+ >>> browser.open('%s/firefox/+addquestion' % answers_url)
1127 >>> browser.getControl('Summary').value = 'Another question'
1128 >>> browser.getControl('Continue').click()
1129 >>> browser.getControl('Description').value = 'More detail.'
1130
1131=== modified file 'lib/lp/services/mailman/doc/create-lists.txt'
1132--- lib/lp/services/mailman/doc/create-lists.txt 2009-12-02 22:56:09 +0000
1133+++ lib/lp/services/mailman/doc/create-lists.txt 2010-10-20 05:19:46 +0000
1134@@ -5,8 +5,10 @@
1135 No Privileges Person wants to create a mailing list on Launchpad. She first
1136 starts by registering a team for her mailing list.
1137
1138+ >>> from canonical.testing.layers import BaseLayer
1139+ >>> root_url = BaseLayer.appserver_root_url()
1140 >>> browser = Browser('no-priv@canonical.com:test')
1141- >>> browser.open('http://launchpad.dev:8085/people/+newteam')
1142+ >>> browser.open('%s/people/+newteam' % root_url)
1143 >>> browser.getControl(name='field.name').value = 'itest-one'
1144 >>> browser.getControl('Display Name').value = 'ITest One'
1145 >>> browser.getControl(name='field.subscriptionpolicy').displayValue = [
1146
1147=== modified file 'lib/lp/services/mailman/doc/deactivate-lists.txt'
1148--- lib/lp/services/mailman/doc/deactivate-lists.txt 2010-04-26 16:00:31 +0000
1149+++ lib/lp/services/mailman/doc/deactivate-lists.txt 2010-10-20 05:19:46 +0000
1150@@ -23,8 +23,10 @@
1151
1152 The team administrator can deactivate the list through the web.
1153
1154+ >>> from canonical.testing.layers import BaseLayer
1155+ >>> root_url = BaseLayer.appserver_root_url()
1156 >>> browser = Browser('no-priv@canonical.com:test')
1157- >>> browser.open('http://launchpad.dev:8085/~itest-one/+mailinglist')
1158+ >>> browser.open('%s/~itest-one/+mailinglist' % root_url)
1159 >>> browser.getControl('Deactivate this Mailing List').click()
1160 >>> xmlrpc_watcher.wait_for_deactivation('itest-one')
1161
1162
1163=== modified file 'lib/lp/services/mailman/doc/decorations.txt'
1164--- lib/lp/services/mailman/doc/decorations.txt 2009-09-24 18:51:29 +0000
1165+++ lib/lp/services/mailman/doc/decorations.txt 2010-10-20 05:19:46 +0000
1166@@ -114,8 +114,10 @@
1167
1168 This url should exactly match the link given on the team's overview page.
1169
1170+ >>> from canonical.testing.layers import BaseLayer
1171+ >>> root_url = BaseLayer.appserver_root_url()
1172 >>> browser = Browser('no-priv@canonical.com:test')
1173- >>> browser.open('http://launchpad.dev:8085/~itest-one')
1174+ >>> browser.open('%s/~itest-one' % root_url)
1175 >>> browser.getLink(id='mailing-list-archive')
1176 <Link text='View archive' url='http://lists.launchpad.dev/itest-one'>
1177 >>> print message['list-archive']
1178
1179=== modified file 'lib/lp/services/mailman/doc/modify-lists.txt'
1180--- lib/lp/services/mailman/doc/modify-lists.txt 2009-12-02 22:56:09 +0000
1181+++ lib/lp/services/mailman/doc/modify-lists.txt 2010-10-20 05:19:46 +0000
1182@@ -13,8 +13,10 @@
1183 Once the list is created, the team owner can change the welcome message
1184 through the web.
1185
1186+ >>> from canonical.testing.layers import BaseLayer
1187+ >>> root_url = BaseLayer.appserver_root_url()
1188 >>> browser = Browser('no-priv@canonical.com:test')
1189- >>> browser.open('http://launchpad.dev:8085/~itest-one/+mailinglist')
1190+ >>> browser.open('%s/~itest-one/+mailinglist' % root_url)
1191 >>> browser.getControl('Welcome message text').value = (
1192 ... 'Salutations team members!')
1193 >>> browser.getControl('Save').click()
1194
1195=== modified file 'lib/lp/services/mailman/doc/postings.txt'
1196--- lib/lp/services/mailman/doc/postings.txt 2010-10-14 18:42:19 +0000
1197+++ lib/lp/services/mailman/doc/postings.txt 2010-10-20 05:19:46 +0000
1198@@ -117,7 +117,7 @@
1199 <BLANKLINE>
1200 Subject: An unsubscribed post
1201 Author name: Anne Person
1202- Author url: http://launchpad.dev:8085/~anne
1203+ Author url: http://launchpad.dev:.../~anne
1204 Date: ...
1205 Message-ID: <caribou>
1206 <BLANKLINE>
1207@@ -128,7 +128,7 @@
1208 <BLANKLINE>
1209 To review all messages pending approval, visit:
1210 <BLANKLINE>
1211- http://launchpad.dev:8085/~itest-one/+mailinglist-moderate
1212+ http://launchpad.dev:.../~itest-one/+mailinglist-moderate
1213 <BLANKLINE>
1214 Regards,
1215 The Launchpad team
1216@@ -153,9 +153,10 @@
1217 declining the message, Launchpad forgets about it, while Mailman sends a
1218 rejection notice to Anne.
1219
1220+ >>> from canonical.testing.layers import BaseLayer
1221+ >>> root_url = BaseLayer.appserver_root_url()
1222 >>> browser = Browser('no-priv@canonical.com:test')
1223- >>> browser.open(
1224- ... 'http://launchpad.dev:8085/~itest-one/+mailinglist-moderate')
1225+ >>> browser.open('%s/~itest-one/+mailinglist-moderate' % root_url)
1226 >>> browser.getControl(name='field.%3Ccaribou%3E').value = [
1227 ... 'reject']
1228 >>> browser.getControl('Moderate').click()
1229@@ -226,13 +227,12 @@
1230 <BLANKLINE>
1231 Subject: Wanna buy something?
1232 Author name: Anne Person
1233- Author url: http://launchpad.dev:8085/~anne
1234+ Author url: http://launchpad.dev:.../~anne
1235 Date: ...
1236 Message-ID: <donkey>
1237 ...
1238
1239- >>> browser.open(
1240- ... 'http://launchpad.dev:8085/~itest-one/+mailinglist-moderate')
1241+ >>> browser.open('%s/~itest-one/+mailinglist-moderate' % root_url)
1242 >>> browser.getControl(name='field.%3Cdonkey%3E').value = [
1243 ... 'discard']
1244 >>> browser.getControl('Moderate').click()
1245@@ -273,7 +273,7 @@
1246 <BLANKLINE>
1247 Subject: Another unsubscribed post
1248 Author name: Anne Person
1249- Author url: http://launchpad.dev:8085/~anne
1250+ Author url: http://launchpad.dev:.../~anne
1251 Date: ...
1252 Message-ID: <elephant>
1253 ...
1254@@ -290,8 +290,7 @@
1255 Hi, I am still not yet a member of this team's list.
1256 <BLANKLINE>
1257
1258- >>> browser.open(
1259- ... 'http://launchpad.dev:8085/~itest-one/+mailinglist-moderate')
1260+ >>> browser.open('%s/~itest-one/+mailinglist-moderate' % root_url)
1261 >>> browser.getControl(name='field.%3Celephant%3E').value = [
1262 ... 'approve']
1263 >>> browser.getControl('Moderate').click()
1264@@ -603,15 +602,14 @@
1265 ...
1266 Subject: A non-team member post
1267 Author name: Anne Person
1268- Author url: http://launchpad.dev:8085/~anne
1269+ Author url: http://launchpad.dev:.../~anne
1270 Date: ...
1271 Message-ID: <horse>
1272 ...
1273
1274 The team administrator discards the message.
1275
1276- >>> browser.open(
1277- ... 'http://launchpad.dev:8085/~itest-one/+mailinglist-moderate')
1278+ >>> browser.open('%s/~itest-one/+mailinglist-moderate' % root_url)
1279 >>> browser.getControl(name='field.%3Chorse%3E').value = [
1280 ... 'discard']
1281 >>> browser.getControl('Moderate').click()
1282@@ -774,8 +772,7 @@
1283 Should a non-team member's held post be approved, they are then allowed to
1284 post to just that mailing list without further approval required.
1285
1286- >>> browser.open(
1287- ... 'http://launchpad.dev:8085/~itest-one/+mailinglist-moderate')
1288+ >>> browser.open('%s/~itest-one/+mailinglist-moderate' % root_url)
1289 >>> browser.getControl(name='field.%3Cmongoose%3E').value = ['approve']
1290 >>> browser.getControl('Moderate').click()
1291 >>> smtpd_watcher.wait_for_mbox_delivery('mongoose')
1292@@ -870,8 +867,7 @@
1293
1294 Once this message is approved, it is posted through to the mailing list.
1295
1296- >>> browser.open(
1297- ... 'http://launchpad.dev:8085/~itest-one/+mailinglist-moderate')
1298+ >>> browser.open('%s/~itest-one/+mailinglist-moderate' % root_url)
1299 >>> browser.getControl(name='field.%3Cpuma%3E').value = ['approve']
1300 >>> browser.getControl('Moderate').click()
1301 >>> smtpd_watcher.wait_for_mbox_delivery('puma')
1302
1303=== modified file 'lib/lp/services/mailman/doc/reactivate-lists.txt'
1304--- lib/lp/services/mailman/doc/reactivate-lists.txt 2010-04-15 11:44:04 +0000
1305+++ lib/lp/services/mailman/doc/reactivate-lists.txt 2010-10-20 05:19:46 +0000
1306@@ -14,8 +14,10 @@
1307
1308 Give the mailing list a welcome message.
1309
1310+ >>> from canonical.testing.layers import BaseLayer
1311+ >>> root_url = BaseLayer.appserver_root_url()
1312 >>> browser = Browser('no-priv@canonical.com:test')
1313- >>> browser.open('http://launchpad.dev:8085/~itest-one/+mailinglist')
1314+ >>> browser.open('%s/~itest-one/+mailinglist' % root_url)
1315 >>> browser.getControl('Welcome message text').value = (
1316 ... 'Greetings team one members!')
1317 >>> browser.getControl('Save').click()
1318
1319=== modified file 'lib/lp/services/mailman/doc/recovery.txt'
1320--- lib/lp/services/mailman/doc/recovery.txt 2010-10-09 16:36:22 +0000
1321+++ lib/lp/services/mailman/doc/recovery.txt 2010-10-20 05:19:46 +0000
1322@@ -13,8 +13,10 @@
1323 Mailman and Launchpad should eventually resynchronize their state
1324 automatically.
1325
1326+ >>> from canonical.testing.layers import BaseLayer
1327+ >>> root_url = BaseLayer.appserver_root_url()
1328 >>> browser = Browser('no-priv@canonical.com:test')
1329- >>> browser.open('http://launchpad.dev:8085/people/+newteam')
1330+ >>> browser.open('%s/people/+newteam' % root_url)
1331 >>> browser.getControl(name='field.name').value = 'itest-one'
1332 >>> browser.getControl('Display Name').value = 'ITest One'
1333 >>> browser.getControl(name='field.subscriptionpolicy').displayValue = [
1334@@ -56,7 +58,7 @@
1335 However, if the list status on Launchpad is CONSTRUCTING, but the mailing list
1336 does not actually exist in Mailman, then Mailman will create it.
1337
1338- >>> browser.open('http://launchpad.dev:8085/people/+newteam')
1339+ >>> browser.open('%s/people/+newteam' % root_url)
1340 >>> browser.getControl(name='field.name').value = 'itest-two'
1341 >>> browser.getControl('Display Name').value = 'ITest Two'
1342 >>> browser.getControl(name='field.subscriptionpolicy').displayValue = [
1343
1344=== modified file 'lib/lp/services/mailman/testing/helpers.py'
1345--- lib/lp/services/mailman/testing/helpers.py 2010-08-20 20:31:18 +0000
1346+++ lib/lp/services/mailman/testing/helpers.py 2010-10-20 05:19:46 +0000
1347@@ -99,7 +99,7 @@
1348 word.capitalize() for word in team_name.split('-'))
1349 browser = Browser('no-priv@canonical.com:test')
1350 # Create the team.
1351- browser.open('http://launchpad.dev:8085/people/+newteam')
1352+ browser.open('%s/people/+newteam' % MailmanLayer.appserver_root_url())
1353 browser.getControl(name='field.name').value = team_name
1354 browser.getControl('Display Name').value = displayname
1355 browser.getControl(name='field.subscriptionpolicy').displayValue = [
1356@@ -243,7 +243,7 @@
1357 """Like mailinglists_helper.apply_for_list() but with the right rooturl.
1358 """
1359 mailinglists_helper.apply_for_list(
1360- browser, team_name, 'http://launchpad.dev:8085/')
1361+ browser, team_name, MailmanLayer.appserver_root_url(ensureSlash=True))
1362
1363
1364 def _membership_test(team_name, people, predicate):
1365
1366=== modified file 'lib/lp/soyuz/windmill/testing.py'
1367--- lib/lp/soyuz/windmill/testing.py 2009-09-29 12:09:39 +0000
1368+++ lib/lp/soyuz/windmill/testing.py 2010-10-20 05:19:46 +0000
1369@@ -15,4 +15,10 @@
1370 class SoyuzWindmillLayer(BaseWindmillLayer):
1371 """Layer for Soyuz Windmill tests."""
1372
1373- base_url = 'http://launchpad.dev:8085/'
1374+ @classmethod
1375+ def setUp(cls):
1376+ cls.base_url = cls.appserver_root_url()
1377+ super(SoyuzWindmillLayer, cls).setUp()
1378+
1379+
1380+
1381
1382=== modified file 'lib/lp/soyuz/windmill/tests/test_archive_packages.py'
1383--- lib/lp/soyuz/windmill/tests/test_archive_packages.py 2010-08-16 10:24:17 +0000
1384+++ lib/lp/soyuz/windmill/tests/test_archive_packages.py 2010-10-20 05:19:46 +0000
1385@@ -15,7 +15,8 @@
1386 """A successful request for the extra info updates the display."""
1387
1388 self.client.open(
1389- url='http://launchpad.dev:8085/~cprov/+archive/ppa/+packages')
1390+ url='%s/~cprov/+archive/ppa/+packages'
1391+ % SoyuzWindmillLayer.base_url)
1392 self.client.waits.forPageLoad(timeout=constants.PAGE_LOAD)
1393
1394 self.client.click(id="pub29-expander")
1395
1396=== modified file 'lib/lp/soyuz/windmill/tests/test_archivesubscribersindex.py'
1397--- lib/lp/soyuz/windmill/tests/test_archivesubscribersindex.py 2010-08-20 20:31:18 +0000
1398+++ lib/lp/soyuz/windmill/tests/test_archivesubscribersindex.py 2010-10-20 05:19:46 +0000
1399@@ -64,8 +64,9 @@
1400
1401 self.lpuser.ensure_login(client)
1402
1403- client.open(url='http://launchpad.dev:8085/~joe-bloggs/'
1404- '+archive/myppa/+subscriptions')
1405+ client.open(url='%s/~joe-bloggs/'
1406+ '+archive/myppa/+subscriptions'
1407+ % SoyuzWindmillLayer.base_url)
1408 client.waits.forPageLoad(timeout=constants.PAGE_LOAD)
1409
1410 # Click on the JS add access action.
1411
1412=== modified file 'lib/lp/soyuz/windmill/tests/test_ppainlineedit.py'
1413--- lib/lp/soyuz/windmill/tests/test_ppainlineedit.py 2010-08-20 20:31:18 +0000
1414+++ lib/lp/soyuz/windmill/tests/test_ppainlineedit.py 2010-10-20 05:19:46 +0000
1415@@ -19,7 +19,7 @@
1416 """Ensure the PPA dispalyname can be edited inline."""
1417
1418 ppa_displayname_inline_edit_test = widgets.InlineEditorWidgetTest(
1419- url='http://launchpad.dev:8085/~cprov/+archive/ppa',
1420+ url='%s/~cprov/+archive/ppa' % SoyuzWindmillLayer.base_url,
1421 widget_id='displayname',
1422 expected_value='PPA for Celso Providelo',
1423 new_value="Celso's default PPA",
1424
1425=== modified file 'lib/lp/testing/__init__.py'
1426--- lib/lp/testing/__init__.py 2010-10-17 21:21:07 +0000
1427+++ lib/lp/testing/__init__.py 2010-10-20 05:19:46 +0000
1428@@ -720,7 +720,7 @@
1429 # do anything before you open() something you'd be operating on the
1430 # page that was last accessed by the previous test, which is the cause
1431 # of things like https://launchpad.net/bugs/515494)
1432- self.client.open(url=u'http://launchpad.dev:8085')
1433+ self.client.open(url=self.layer.appserver_root_url())
1434
1435
1436 class YUIUnitTestCase(WindmillTestCase):
1437@@ -729,16 +729,19 @@
1438 suite_name = ''
1439
1440 _yui_results = None
1441- _view_name = u'http://launchpad.dev:8085/+yui-unittest/'
1442
1443 def initialize(self, test_path):
1444 self.test_path = test_path
1445- self.yui_runner_url = self._view_name + test_path
1446
1447 def setUp(self):
1448 super(YUIUnitTestCase, self).setUp()
1449+ #This goes here to prevent circular import issues
1450+ from canonical.testing.layers import BaseLayer
1451+ _view_name = u'%s/+yui-unittest/' % BaseLayer.appserver_root_url()
1452+ yui_runner_url = _view_name + self.test_path
1453+
1454 client = self.client
1455- client.open(url=self.yui_runner_url)
1456+ client.open(url=yui_runner_url)
1457 client.waits.forPageLoad(timeout=constants.PAGE_LOAD)
1458 client.waits.forElement(id='complete')
1459 response = client.commands.getPageText()
1460
1461=== modified file 'lib/lp/testing/factory.py'
1462--- lib/lp/testing/factory.py 2010-10-18 23:19:16 +0000
1463+++ lib/lp/testing/factory.py 2010-10-20 05:19:46 +0000
1464@@ -3137,8 +3137,9 @@
1465 def makeLaunchpadService(self, person=None):
1466 if person is None:
1467 person = self.makePerson()
1468+ from canonical.testing import BaseLayer
1469 launchpad = launchpadlib_for("test", person,
1470- service_root="http://api.launchpad.dev:8085")
1471+ service_root=BaseLayer.appserver_root_url("api"))
1472 login_person(person)
1473 return launchpad
1474
1475
1476=== modified file 'lib/lp/translations/windmill/testing.py'
1477--- lib/lp/translations/windmill/testing.py 2009-10-28 15:39:02 +0000
1478+++ lib/lp/translations/windmill/testing.py 2010-10-20 05:19:46 +0000
1479@@ -15,4 +15,8 @@
1480 class TranslationsWindmillLayer(BaseWindmillLayer):
1481 """Layer for Translations Windmill tests."""
1482
1483- base_url = 'http://translations.launchpad.dev:8085/'
1484+ @classmethod
1485+ def setUp(cls):
1486+ cls.base_url = cls.appserver_root_url('translations')
1487+ super(TranslationsWindmillLayer, cls).setUp()
1488+
1489
1490=== modified file 'lib/lp/translations/windmill/tests/disabled_test_productseries_templates.py'
1491--- lib/lp/translations/windmill/tests/disabled_test_productseries_templates.py 2010-08-20 20:31:18 +0000
1492+++ lib/lp/translations/windmill/tests/disabled_test_productseries_templates.py 2010-10-20 05:19:46 +0000
1493@@ -48,8 +48,8 @@
1494 * verifies that the action links of the row are deactivated;
1495 """
1496 client = self.client
1497- url = ('http://translations.launchpad.dev:8085/evolution/trunk/'
1498- '+templates')
1499+ url = ('%s/evolution/trunk/+templates'
1500+ % TranslationsWindmillLayer.base_url)
1501 user = lpuser.TRANSLATIONS_ADMIN
1502 # Go to templates page logged in as translations admin.
1503 client.open(url=url)
1504
1505=== modified file 'lib/lp/translations/windmill/tests/test_documentation_links.py'
1506--- lib/lp/translations/windmill/tests/test_documentation_links.py 2010-08-30 21:54:56 +0000
1507+++ lib/lp/translations/windmill/tests/test_documentation_links.py 2010-10-20 05:19:46 +0000
1508@@ -66,8 +66,8 @@
1509 user.ensure_login(client)
1510
1511 client.open(
1512- url=(u'http://translations.launchpad.dev:8085/test-product/trunk'
1513- u'/+pots/template/es/'))
1514+ url=(u'%s/test-product/trunk/+pots/template/es/'
1515+ % TranslationsWindmillLayer.base_url))
1516 client.waits.forPageLoad(timeout=u'20000')
1517
1518 # Make sure notification box is shown.
1519@@ -94,8 +94,8 @@
1520 # notification box is visible even though user dismissed Spanish
1521 # translation notification.
1522 client.open(
1523- url=(u'http://translations.launchpad.dev:8085/test-product/trunk'
1524- u'/+pots/template/ca/'))
1525+ url=(u'%s/test-product/trunk/+pots/template/ca/'
1526+ % TranslationsWindmillLayer.base_url))
1527 client.waits.forPageLoad(timeout=u'20000')
1528 client.asserts.assertNotProperty(
1529 classname=u'important-notice-container',
1530
1531=== modified file 'lib/lp/translations/windmill/tests/test_import_queue.py'
1532--- lib/lp/translations/windmill/tests/test_import_queue.py 2010-08-30 21:54:56 +0000
1533+++ lib/lp/translations/windmill/tests/test_import_queue.py 2010-10-20 05:19:46 +0000
1534@@ -78,7 +78,7 @@
1535 def test_import_queue_entry(self):
1536 """Tests that import queue entry fields behave correctly."""
1537 client = self.client
1538- start_url = 'http://translations.launchpad.dev:8085/+imports/1'
1539+ start_url = '%s/+imports/1' % TranslationsWindmillLayer.base_url
1540 user = lpuser.TRANSLATIONS_ADMIN
1541 # Go to import queue page logged in as translations admin.
1542 user.ensure_login(client)
1543
1544=== modified file 'lib/lp/translations/windmill/tests/test_languages.py'
1545--- lib/lp/translations/windmill/tests/test_languages.py 2010-08-20 20:31:18 +0000
1546+++ lib/lp/translations/windmill/tests/test_languages.py 2010-10-20 05:19:46 +0000
1547@@ -53,7 +53,7 @@
1548 French, because neither its name nor language code contain 'de'.
1549 """
1550 client = self.client
1551- start_url = 'http://translations.launchpad.dev:8085/+languages'
1552+ start_url = '%s/+languages' % TranslationsWindmillLayer.base_url
1553 # Go to the languages page
1554 self.client.open(url=start_url)
1555 self.client.waits.forPageLoad(timeout=PAGE_LOAD)
1556
1557=== modified file 'lib/lp/translations/windmill/tests/test_pofile_translate.py'
1558--- lib/lp/translations/windmill/tests/test_pofile_translate.py 2010-08-20 20:31:18 +0000
1559+++ lib/lp/translations/windmill/tests/test_pofile_translate.py 2010-10-20 05:19:46 +0000
1560@@ -65,26 +65,26 @@
1561 self.test_user = lpuser.TRANSLATIONS_ADMIN
1562
1563 # Test the zoom out view for Evolution trunk Spanish (es).
1564- start_url = ('http://translations.launchpad.dev:8085/'
1565- 'evolution/trunk/+pots/evolution-2.2/es/+translate')
1566+ start_url = ('%s/evolution/trunk/+pots/evolution-2.2/es/+translate'
1567+ % TranslationsWindmillLayer.base_url)
1568 new_translation_id = u'msgset_1_es_translation_0_new'
1569 new_translation_select_id = u'msgset_1_es_translation_0_new_select'
1570 self._checkTranslationAutoselect(
1571 start_url, new_translation_id, new_translation_select_id)
1572
1573 # Test the zoom in view for Evolution trunk Brazilian (pt_BR).
1574- start_url = ('http://translations.launchpad.dev:8085/'
1575- 'evolution/trunk/+pots/evolution-2.2/'
1576- 'pt_BR/1/+translate')
1577+ start_url = ('%s/evolution/trunk/+pots/evolution-2.2/'
1578+ 'pt_BR/1/+translate'
1579+ % TranslationsWindmillLayer.base_url )
1580 new_translation_id = u'msgset_1_pt_BR_translation_0_new'
1581 new_translation_select_id = u'msgset_1_pt_BR_translation_0_new_select'
1582 self._checkTranslationAutoselect(
1583 start_url, new_translation_id, new_translation_select_id)
1584
1585 # Test the zoom out view for Ubuntu Hoary Brazilian (pt_BR).
1586- start_url = ('http://translations.launchpad.dev:8085/'
1587- 'ubuntu/hoary/+source/mozilla/+pots/pkgconf-mozilla/'
1588- 'pt_BR/1/+translate')
1589+ start_url = ('%s/ubuntu/hoary/+source/mozilla/+pots/pkgconf-mozilla/'
1590+ 'pt_BR/1/+translate'
1591+ % TranslationsWindmillLayer.base_url)
1592 new_translation_id = u'msgset_152_pt_BR_translation_0_new'
1593 new_translation_select_id = (u'msgset_152_pt_BR'
1594 '_translation_0_new_select')
1595@@ -108,8 +108,8 @@
1596
1597 self.test_user = lpuser.TRANSLATIONS_ADMIN
1598 # Test the zoom out view for Evolution trunk Spanish (es).
1599- url = ('http://translations.launchpad.dev:8085/'
1600- 'evolution/trunk/+pots/evolution-2.2/es/5/+translate')
1601+ url = ('%s/evolution/trunk/+pots/evolution-2.2/es/5/+translate'
1602+ % TranslationsWindmillLayer.base_url)
1603 dismiss_id = u'msgset_5_dismiss'
1604 force_suggestion_id = u'msgset_5_force_suggestion'
1605
1606@@ -164,8 +164,8 @@
1607 transaction.commit()
1608 logout()
1609
1610- url = ('http://translations.launchpad.dev:8085/'
1611- '%s/%s/+pots/%s/pt_BR/1/+translate' % (
1612+ url = ('%s/%s/%s/+pots/%s/pt_BR/1/+translate' % (
1613+ TranslationsWindmillLayer.base_url,
1614 potemplate.product.name,
1615 potemplate.productseries.name,
1616 potemplate.name))
1617@@ -310,9 +310,9 @@
1618
1619 # Go to the zoom in page for a translation with plural forms.
1620 self.client.open(
1621- url='http://translations.launchpad.dev:8085/'
1622- 'ubuntu/hoary/+source/evolution/+pots/'
1623- 'evolution-2.2/es/15/+translate')
1624+ url='%s/ubuntu/hoary/+source/evolution/+pots/'
1625+ 'evolution-2.2/es/15/+translate'
1626+ % TranslationsWindmillLayer.base_url)
1627 self.client.waits.forPageLoad(timeout=constants.PAGE_LOAD)
1628 user.ensure_login(self.client)
1629
1630@@ -333,9 +333,9 @@
1631 # pt_BR is a language code using the same delimiter as HTTP form
1632 # fields and are prone to errors.
1633 self.client.open(
1634- url='http://translations.launchpad.dev:8085/'
1635- 'ubuntu/hoary/+source/evolution/+pots/'
1636- 'evolution-2.2/pt_BR/15/+translate')
1637+ url='%s/ubuntu/hoary/+source/evolution/+pots/'
1638+ 'evolution-2.2/pt_BR/15/+translate'
1639+ % TranslationsWindmillLayer.base_url)
1640 self.client.waits.forPageLoad(timeout=constants.PAGE_LOAD)
1641
1642 checkbox = u'msgset_144_force_suggestion'
1643@@ -354,9 +354,9 @@
1644
1645 # Go to the zoom in page for a translation without plural forms.
1646 self.client.open(
1647- url='http://translations.launchpad.dev:8085/'
1648- 'ubuntu/hoary/+source/evolution/+pots/'
1649- 'evolution-2.2/es/19/+translate')
1650+ url='%s/ubuntu/hoary/+source/evolution/+pots/'
1651+ 'evolution-2.2/es/19/+translate'
1652+ % TranslationsWindmillLayer.base_url)
1653 self.client.waits.forPageLoad(timeout=constants.PAGE_LOAD)
1654
1655 checkbox = u'msgset_148_force_suggestion'
1656@@ -370,9 +370,9 @@
1657
1658 # Go to the zoom out page for some translations.
1659 self.client.open(
1660- url='http://translations.launchpad.dev:8085/'
1661- 'ubuntu/hoary/+source/evolution/+pots/'
1662- 'evolution-2.2/es/+translate')
1663+ url='%s/ubuntu/hoary/+source/evolution/+pots/'
1664+ 'evolution-2.2/es/+translate'
1665+ % TranslationsWindmillLayer.base_url)
1666 self.client.waits.forPageLoad(timeout=constants.PAGE_LOAD)
1667
1668 checkbox = u'msgset_130_force_suggestion'
1669@@ -426,8 +426,8 @@
1670 """
1671
1672 self.client.open(
1673- url='http://translations.launchpad.dev:8085/'
1674- 'evolution/trunk/+pots/evolution-2.2/pt_BR/1/+translate')
1675+ url='%s/evolution/trunk/+pots/evolution-2.2/pt_BR/1/+translate'
1676+ % TranslationsWindmillLayer.base_url)
1677 self.client.waits.forPageLoad(timeout=constants.PAGE_LOAD)
1678 self.test_user.ensure_login(self.client)
1679
1680@@ -445,8 +445,8 @@
1681 """
1682
1683 self.client.open(
1684- url='http://translations.launchpad.dev:8085'
1685- '/evolution/trunk/+pots/evolution-2.2/pt_BR/1/+translate')
1686+ url='%s/evolution/trunk/+pots/evolution-2.2/pt_BR/1/+translate'
1687+ % TranslationsWindmillLayer.base_url)
1688 self.client.waits.forPageLoad(timeout=constants.PAGE_LOAD)
1689 self.test_user.ensure_login(self.client)
1690
1691
1692=== modified file 'lib/lp/translations/windmill/tests/test_serieslanguages.py'
1693--- lib/lp/translations/windmill/tests/test_serieslanguages.py 2010-08-20 20:31:18 +0000
1694+++ lib/lp/translations/windmill/tests/test_serieslanguages.py 2010-10-20 05:19:46 +0000
1695@@ -47,7 +47,7 @@
1696 person having Catalan and Spanish as preferred languages.
1697 """
1698 client = self.client
1699- start_url = 'http://translations.launchpad.dev:8085/ubuntu'
1700+ start_url = '%s/ubuntu' % TranslationsWindmillLayer.base_url
1701 user = lpuser.TRANSLATIONS_ADMIN
1702 # Go to the distribution languages page
1703 self.client.open(url=start_url)
1704@@ -78,4 +78,3 @@
1705 u'French': True,
1706 u'Croatian': True,
1707 })
1708-

Subscribers

People subscribed via source and target branches

to status/vote changes: