~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/testing/fixture.py

  • Committer: mbp at canonical
  • Date: 2011-12-01 02:22:36 UTC
  • mto: This revision was merged to the branch mainline in revision 14469.
  • Revision ID: mbp@canonical.com-20111201022236-8jlyzk5iy33tdo5o
Split out DemoMode test fixture

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
__metaclass__ = type
7
7
__all__ = [
8
8
    'CaptureOops',
 
9
    'DemoMode',
9
10
    'PGBouncerFixture',
10
11
    'Urllib2Fixture',
11
12
    'ZopeAdapterFixture',
344
345
        self.timeline = get_request_timeline(
345
346
            get_current_browser_request())
346
347
        self.addCleanup(webapp.adapter.clear_request_started)
 
348
 
 
349
 
 
350
class DemoMode(Fixture):
 
351
    """Run with an is_demo configuration.
 
352
 
 
353
    This changes the page styling, feature flag permissions, and perhaps
 
354
    other things.
 
355
    """
 
356
 
 
357
    def setUp(self):
 
358
        Fixture.setUp(self)
 
359
        config.push('demo-fixture', '''
 
360
[launchpad]
 
361
is_demo: true
 
362
site_message = This is a demo site mmk. \
 
363
<a href="http://example.com">File a bug</a>.
 
364
            ''')
 
365
        self.addCleanup(lambda: config.pop('demo-fixture'))