Merge lp://staging/~bjornt/launchpad/bug-432040 into lp://staging/launchpad

Proposed by Björn Tillenius
Status: Merged
Merged at revision: not available
Proposed branch: lp://staging/~bjornt/launchpad/bug-432040
Merge into: lp://staging/launchpad
Diff against target: None lines
To merge this branch: bzr merge lp://staging/~bjornt/launchpad/bug-432040
Reviewer Review Type Date Requested Status
Guilherme Salgado (community) Approve
Review via email: mp+12047@code.staging.launchpad.net
To post a comment you must log in.
Revision history for this message
Björn Tillenius (bjornt) wrote :

Make sure that the DB is reset between Windmill tests.

It turned out that this is already the case, so all I've done is to add
a tests to make sure it won't regress.

--
Björn Tillenius | https://launchpad.net/~bjornt

Revision history for this message
Guilherme Salgado (salgado) wrote :

Looks good to me, but you could use lp.testing.TestCase instead of unittest.TestCase as the former has some extra goodies, specially when reporting failures.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added file 'lib/canonical/testing/tests/test_layers.py'
--- lib/canonical/testing/tests/test_layers.py 1970-01-01 00:00:00 +0000
+++ lib/canonical/testing/tests/test_layers.py 2009-09-18 11:57:13 +0000
@@ -0,0 +1,28 @@
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"""Tests for test layers."""
5
6__metaclass__ = type
7__all__ = []
8
9import unittest
10
11from canonical.testing.layers import BaseWindmillLayer, DatabaseLayer
12
13
14class TestBaseWindmillLayer(unittest.TestCase):
15
16 layer_to_test = BaseWindmillLayer
17
18 def test_db_reset_between_tests(self):
19 # The db is reset between tests when DatabaseLayer layer's
20 # testSetUp is called, if _reset_between_tests is True.
21 self.assertTrue(
22 issubclass(self.layer_to_test, DatabaseLayer))
23 self.assertTrue(self.layer_to_test._reset_between_tests)
24
25
26
27def test_suite():
28 return unittest.TestLoader().loadTestsFromName(__name__)