~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/testing/windmill/lpuser.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-06-27 23:10:34 UTC
  • mfrom: (13299.1.18 windmill-death)
  • Revision ID: launchpad@pqm.canonical.com-20110627231034-rykdadu5vb2uqzpz
[r=sinzui,
 stevenk][no-qa] Remove Windmill test infrastructure and annotate old
 tests for refactoring.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright 2009 Canonical Ltd.  This software is licensed under the
2
 
# GNU Affero General Public License version 3 (see the file LICENSE).
3
 
 
4
 
"""Utilities for Windmill tests written in Python."""
5
 
 
6
 
__metaclass__ = type
7
 
__all__ = []
8
 
 
9
 
import windmill
10
 
 
11
 
 
12
 
def get_basic_login_url(email, password):
13
 
    """Return the constructed url to login a user."""
14
 
    base_url = windmill.settings['TEST_URL']
15
 
    basic_auth_url = base_url.replace('http://', 'http://%s:%s@')
16
 
    basic_auth_url = basic_auth_url + '+basiclogin'
17
 
    return basic_auth_url % (email, password)
18
 
 
19
 
 
20
 
class LaunchpadUser:
21
 
    """Object representing well-known user on Launchpad."""
22
 
 
23
 
    def __init__(self, display_name, email, password):
24
 
        self.display_name = display_name
25
 
        self.email = email
26
 
        self.password = password
27
 
 
28
 
 
29
 
# Well Known Users
30
 
SAMPLE_PERSON = LaunchpadUser(
31
 
    'Sample Person', 'test@canonical.com', 'test')
32
 
 
33
 
FOO_BAR = LaunchpadUser(
34
 
    'Foo Bar', 'foo.bar@canonical.com', 'test')
35
 
 
36
 
NO_PRIV = LaunchpadUser(
37
 
    'No Privileges User', 'no-priv@canonical.com', 'test')
38
 
 
39
 
TRANSLATIONS_ADMIN = LaunchpadUser(
40
 
    u'Carlos Perell\xf3 Mar\xedn', 'carlos@canonical.com', 'test')