annotate test/test_postgresql.py @ 5098:99e289359798

issue2550803: Replying to NOSY mail goes to the tracker through reply-to, not original message author. Created new [tracker] replyto_address config.ini option to allow: 1) setting reply-to header to the tracker 2) setting reply-to header to the address of the author of the change 3) setting it to a fixed address (like noreply@some.place) Proposal by Peter Funk (pefu) in discussion with Tom Ekberg (tekberg). I chose to re-retrieve the email address for the author from the database rather than adding a new variable. Also managed to make a test case for each of the three settings.
author John Rouillard <rouilj@ieee.org>
date Sun, 26 Jun 2016 00:36:23 -0400
parents c977f3530944
children 37d1e24fb941
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1873
f63aa57386b0 Backend improvements.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
1 #
f63aa57386b0 Backend improvements.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
2 # Copyright (c) 2001 Bizar Software Pty Ltd (http://www.bizarsoftware.com.au/)
f63aa57386b0 Backend improvements.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
3 # This module is free software, and you may redistribute it and/or modify
f63aa57386b0 Backend improvements.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
4 # under the same terms as Python, so long as this copyright message and
f63aa57386b0 Backend improvements.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
5 # disclaimer are retained in their original form.
f63aa57386b0 Backend improvements.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
6 #
f63aa57386b0 Backend improvements.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
7 # IN NO EVENT SHALL BIZAR SOFTWARE PTY LTD BE LIABLE TO ANY PARTY FOR
f63aa57386b0 Backend improvements.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
8 # DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING
f63aa57386b0 Backend improvements.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
9 # OUT OF THE USE OF THIS CODE, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE
f63aa57386b0 Backend improvements.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
10 # POSSIBILITY OF SUCH DAMAGE.
f63aa57386b0 Backend improvements.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
11 #
f63aa57386b0 Backend improvements.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
12 # BIZAR SOFTWARE PTY LTD SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
f63aa57386b0 Backend improvements.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
f63aa57386b0 Backend improvements.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS"
f63aa57386b0 Backend improvements.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
f63aa57386b0 Backend improvements.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
f63aa57386b0 Backend improvements.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
17
2075
b1704ba7be41 make mysql / postgresql work again. beginnings of otk/session store in rdbmses
Richard Jones <richard@users.sourceforge.net>
parents: 1920
diff changeset
18 import unittest
1873
f63aa57386b0 Backend improvements.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
19
5036
380d8d8b30a3 Replace existing run_tests.py script with a pytest script
John Kristensen <john@jerrykan.com>
parents: 5033
diff changeset
20 import pytest
1873
f63aa57386b0 Backend improvements.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
21 from roundup.hyperdb import DatabaseError
f63aa57386b0 Backend improvements.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
22
1906
f255363e6d97 PostgreSQL backend lands.
Richard Jones <richard@users.sourceforge.net>
parents: 1877
diff changeset
23 from db_test_base import DBTest, ROTest, config, SchemaTest, ClassicInitTest
4878
f6e76a03b502 HTML* classes for cgi are now all new-style
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4570
diff changeset
24 from db_test_base import ConcurrentDBTest, HTMLItemTest, FilterCacheTest
4887
05c857e5dbed New rdbms configuration option 'isolation_level'
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4878
diff changeset
25 from db_test_base import ClassicInitBase, setupTracker
1906
f255363e6d97 PostgreSQL backend lands.
Richard Jones <richard@users.sourceforge.net>
parents: 1877
diff changeset
26
2856
adec352e2ce0 don't try to import all backends in backends.__init__ unless we *want* to
Richard Jones <richard@users.sourceforge.net>
parents: 2682
diff changeset
27 from roundup.backends import get_backend, have_backend
1906
f255363e6d97 PostgreSQL backend lands.
Richard Jones <richard@users.sourceforge.net>
parents: 1877
diff changeset
28
5038
c977f3530944 Work-around for pytest.mark.skipif() bug
John Kristensen <john@jerrykan.com>
parents: 5037
diff changeset
29 # FIX: workaround for a bug in pytest.mark.skipif():
c977f3530944 Work-around for pytest.mark.skipif() bug
John Kristensen <john@jerrykan.com>
parents: 5037
diff changeset
30 # https://github.com/pytest-dev/pytest/issues/568
5036
380d8d8b30a3 Replace existing run_tests.py script with a pytest script
John Kristensen <john@jerrykan.com>
parents: 5033
diff changeset
31 if not have_backend('postgresql'):
5038
c977f3530944 Work-around for pytest.mark.skipif() bug
John Kristensen <john@jerrykan.com>
parents: 5037
diff changeset
32 skip_postgresql = pytest.skip(
c977f3530944 Work-around for pytest.mark.skipif() bug
John Kristensen <john@jerrykan.com>
parents: 5037
diff changeset
33 'Skipping PostgreSQL tests: backend not available')
5036
380d8d8b30a3 Replace existing run_tests.py script with a pytest script
John Kristensen <john@jerrykan.com>
parents: 5033
diff changeset
34 else:
5038
c977f3530944 Work-around for pytest.mark.skipif() bug
John Kristensen <john@jerrykan.com>
parents: 5037
diff changeset
35 skip_postgresql = lambda func, *args, **kwargs: func
5036
380d8d8b30a3 Replace existing run_tests.py script with a pytest script
John Kristensen <john@jerrykan.com>
parents: 5033
diff changeset
36
380d8d8b30a3 Replace existing run_tests.py script with a pytest script
John Kristensen <john@jerrykan.com>
parents: 5033
diff changeset
37
1873
f63aa57386b0 Backend improvements.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
38 class postgresqlOpener:
2856
adec352e2ce0 don't try to import all backends in backends.__init__ unless we *want* to
Richard Jones <richard@users.sourceforge.net>
parents: 2682
diff changeset
39 if have_backend('postgresql'):
adec352e2ce0 don't try to import all backends in backends.__init__ unless we *want* to
Richard Jones <richard@users.sourceforge.net>
parents: 2682
diff changeset
40 module = get_backend('postgresql')
1873
f63aa57386b0 Backend improvements.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
41
1906
f255363e6d97 PostgreSQL backend lands.
Richard Jones <richard@users.sourceforge.net>
parents: 1877
diff changeset
42 def setUp(self):
2075
b1704ba7be41 make mysql / postgresql work again. beginnings of otk/session store in rdbmses
Richard Jones <richard@users.sourceforge.net>
parents: 1920
diff changeset
43 pass
1906
f255363e6d97 PostgreSQL backend lands.
Richard Jones <richard@users.sourceforge.net>
parents: 1877
diff changeset
44
1873
f63aa57386b0 Backend improvements.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
45 def tearDown(self):
1920
f9316d2cd5ba Fixed retirement of items in rdbms imports [SF#841355]
Richard Jones <richard@users.sourceforge.net>
parents: 1906
diff changeset
46 self.nuke_database()
f9316d2cd5ba Fixed retirement of items in rdbms imports [SF#841355]
Richard Jones <richard@users.sourceforge.net>
parents: 1906
diff changeset
47
f9316d2cd5ba Fixed retirement of items in rdbms imports [SF#841355]
Richard Jones <richard@users.sourceforge.net>
parents: 1906
diff changeset
48 def nuke_database(self):
2075
b1704ba7be41 make mysql / postgresql work again. beginnings of otk/session store in rdbmses
Richard Jones <richard@users.sourceforge.net>
parents: 1920
diff changeset
49 # clear out the database - easiest way is to nuke and re-create it
2856
adec352e2ce0 don't try to import all backends in backends.__init__ unless we *want* to
Richard Jones <richard@users.sourceforge.net>
parents: 2682
diff changeset
50 self.module.db_nuke(config)
1873
f63aa57386b0 Backend improvements.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
51
5033
63c79c0992ae Update tests to work with py.test
John Kristensen <john@jerrykan.com>
parents: 4887
diff changeset
52
5036
380d8d8b30a3 Replace existing run_tests.py script with a pytest script
John Kristensen <john@jerrykan.com>
parents: 5033
diff changeset
53 @skip_postgresql
5033
63c79c0992ae Update tests to work with py.test
John Kristensen <john@jerrykan.com>
parents: 4887
diff changeset
54 class postgresqlDBTest(postgresqlOpener, DBTest, unittest.TestCase):
1906
f255363e6d97 PostgreSQL backend lands.
Richard Jones <richard@users.sourceforge.net>
parents: 1877
diff changeset
55 def setUp(self):
f255363e6d97 PostgreSQL backend lands.
Richard Jones <richard@users.sourceforge.net>
parents: 1877
diff changeset
56 postgresqlOpener.setUp(self)
f255363e6d97 PostgreSQL backend lands.
Richard Jones <richard@users.sourceforge.net>
parents: 1877
diff changeset
57 DBTest.setUp(self)
f255363e6d97 PostgreSQL backend lands.
Richard Jones <richard@users.sourceforge.net>
parents: 1877
diff changeset
58
f255363e6d97 PostgreSQL backend lands.
Richard Jones <richard@users.sourceforge.net>
parents: 1877
diff changeset
59 def tearDown(self):
f255363e6d97 PostgreSQL backend lands.
Richard Jones <richard@users.sourceforge.net>
parents: 1877
diff changeset
60 DBTest.tearDown(self)
f255363e6d97 PostgreSQL backend lands.
Richard Jones <richard@users.sourceforge.net>
parents: 1877
diff changeset
61 postgresqlOpener.tearDown(self)
f255363e6d97 PostgreSQL backend lands.
Richard Jones <richard@users.sourceforge.net>
parents: 1877
diff changeset
62
5033
63c79c0992ae Update tests to work with py.test
John Kristensen <john@jerrykan.com>
parents: 4887
diff changeset
63
5036
380d8d8b30a3 Replace existing run_tests.py script with a pytest script
John Kristensen <john@jerrykan.com>
parents: 5033
diff changeset
64 @skip_postgresql
5033
63c79c0992ae Update tests to work with py.test
John Kristensen <john@jerrykan.com>
parents: 4887
diff changeset
65 class postgresqlROTest(postgresqlOpener, ROTest, unittest.TestCase):
1906
f255363e6d97 PostgreSQL backend lands.
Richard Jones <richard@users.sourceforge.net>
parents: 1877
diff changeset
66 def setUp(self):
f255363e6d97 PostgreSQL backend lands.
Richard Jones <richard@users.sourceforge.net>
parents: 1877
diff changeset
67 postgresqlOpener.setUp(self)
f255363e6d97 PostgreSQL backend lands.
Richard Jones <richard@users.sourceforge.net>
parents: 1877
diff changeset
68 ROTest.setUp(self)
f255363e6d97 PostgreSQL backend lands.
Richard Jones <richard@users.sourceforge.net>
parents: 1877
diff changeset
69
f255363e6d97 PostgreSQL backend lands.
Richard Jones <richard@users.sourceforge.net>
parents: 1877
diff changeset
70 def tearDown(self):
f255363e6d97 PostgreSQL backend lands.
Richard Jones <richard@users.sourceforge.net>
parents: 1877
diff changeset
71 ROTest.tearDown(self)
f255363e6d97 PostgreSQL backend lands.
Richard Jones <richard@users.sourceforge.net>
parents: 1877
diff changeset
72 postgresqlOpener.tearDown(self)
1873
f63aa57386b0 Backend improvements.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
73
5033
63c79c0992ae Update tests to work with py.test
John Kristensen <john@jerrykan.com>
parents: 4887
diff changeset
74
5036
380d8d8b30a3 Replace existing run_tests.py script with a pytest script
John Kristensen <john@jerrykan.com>
parents: 5033
diff changeset
75 @skip_postgresql
5033
63c79c0992ae Update tests to work with py.test
John Kristensen <john@jerrykan.com>
parents: 4887
diff changeset
76 class postgresqlConcurrencyTest(postgresqlOpener, ConcurrentDBTest,
63c79c0992ae Update tests to work with py.test
John Kristensen <john@jerrykan.com>
parents: 4887
diff changeset
77 unittest.TestCase):
4448
2784c239e6c8 clear the cache on commit for rdbms backends:
Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net>
parents: 3685
diff changeset
78 backend = 'postgresql'
2784c239e6c8 clear the cache on commit for rdbms backends:
Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net>
parents: 3685
diff changeset
79 def setUp(self):
2784c239e6c8 clear the cache on commit for rdbms backends:
Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net>
parents: 3685
diff changeset
80 postgresqlOpener.setUp(self)
2784c239e6c8 clear the cache on commit for rdbms backends:
Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net>
parents: 3685
diff changeset
81 ConcurrentDBTest.setUp(self)
2784c239e6c8 clear the cache on commit for rdbms backends:
Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net>
parents: 3685
diff changeset
82
2784c239e6c8 clear the cache on commit for rdbms backends:
Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net>
parents: 3685
diff changeset
83 def tearDown(self):
2784c239e6c8 clear the cache on commit for rdbms backends:
Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net>
parents: 3685
diff changeset
84 ConcurrentDBTest.tearDown(self)
2784c239e6c8 clear the cache on commit for rdbms backends:
Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net>
parents: 3685
diff changeset
85 postgresqlOpener.tearDown(self)
2784c239e6c8 clear the cache on commit for rdbms backends:
Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net>
parents: 3685
diff changeset
86
5033
63c79c0992ae Update tests to work with py.test
John Kristensen <john@jerrykan.com>
parents: 4887
diff changeset
87
5036
380d8d8b30a3 Replace existing run_tests.py script with a pytest script
John Kristensen <john@jerrykan.com>
parents: 5033
diff changeset
88 @skip_postgresql
5033
63c79c0992ae Update tests to work with py.test
John Kristensen <john@jerrykan.com>
parents: 4887
diff changeset
89 class postgresqlJournalTest(postgresqlOpener, ClassicInitBase,
63c79c0992ae Update tests to work with py.test
John Kristensen <john@jerrykan.com>
parents: 4887
diff changeset
90 unittest.TestCase):
4887
05c857e5dbed New rdbms configuration option 'isolation_level'
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4878
diff changeset
91 backend = 'postgresql'
05c857e5dbed New rdbms configuration option 'isolation_level'
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4878
diff changeset
92 def setUp(self):
05c857e5dbed New rdbms configuration option 'isolation_level'
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4878
diff changeset
93 postgresqlOpener.setUp(self)
05c857e5dbed New rdbms configuration option 'isolation_level'
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4878
diff changeset
94 ClassicInitBase.setUp(self)
05c857e5dbed New rdbms configuration option 'isolation_level'
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4878
diff changeset
95 self.tracker = setupTracker(self.dirname, self.backend)
05c857e5dbed New rdbms configuration option 'isolation_level'
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4878
diff changeset
96 db = self.tracker.open('admin')
05c857e5dbed New rdbms configuration option 'isolation_level'
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4878
diff changeset
97 self.id = db.issue.create(title='initial value')
05c857e5dbed New rdbms configuration option 'isolation_level'
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4878
diff changeset
98 db.commit()
05c857e5dbed New rdbms configuration option 'isolation_level'
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4878
diff changeset
99 db.close()
05c857e5dbed New rdbms configuration option 'isolation_level'
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4878
diff changeset
100
05c857e5dbed New rdbms configuration option 'isolation_level'
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4878
diff changeset
101 def tearDown(self):
05c857e5dbed New rdbms configuration option 'isolation_level'
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4878
diff changeset
102 self.db1.close()
05c857e5dbed New rdbms configuration option 'isolation_level'
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4878
diff changeset
103 self.db2.close()
05c857e5dbed New rdbms configuration option 'isolation_level'
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4878
diff changeset
104 ClassicInitBase.tearDown(self)
05c857e5dbed New rdbms configuration option 'isolation_level'
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4878
diff changeset
105 postgresqlOpener.tearDown(self)
05c857e5dbed New rdbms configuration option 'isolation_level'
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4878
diff changeset
106
05c857e5dbed New rdbms configuration option 'isolation_level'
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4878
diff changeset
107 def _test_journal(self, expected_journal):
05c857e5dbed New rdbms configuration option 'isolation_level'
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4878
diff changeset
108 id = self.id
05c857e5dbed New rdbms configuration option 'isolation_level'
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4878
diff changeset
109 db1 = self.db1 = self.tracker.open('admin')
05c857e5dbed New rdbms configuration option 'isolation_level'
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4878
diff changeset
110 db2 = self.db2 = self.tracker.open('admin')
05c857e5dbed New rdbms configuration option 'isolation_level'
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4878
diff changeset
111
05c857e5dbed New rdbms configuration option 'isolation_level'
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4878
diff changeset
112 t1 = db1.issue.get(id, 'title')
05c857e5dbed New rdbms configuration option 'isolation_level'
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4878
diff changeset
113 t2 = db2.issue.get(id, 'title')
05c857e5dbed New rdbms configuration option 'isolation_level'
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4878
diff changeset
114
05c857e5dbed New rdbms configuration option 'isolation_level'
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4878
diff changeset
115 db1.issue.set (id, title='t1')
05c857e5dbed New rdbms configuration option 'isolation_level'
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4878
diff changeset
116 db1.commit()
05c857e5dbed New rdbms configuration option 'isolation_level'
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4878
diff changeset
117 db1.close()
05c857e5dbed New rdbms configuration option 'isolation_level'
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4878
diff changeset
118
05c857e5dbed New rdbms configuration option 'isolation_level'
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4878
diff changeset
119 db2.issue.set (id, title='t2')
05c857e5dbed New rdbms configuration option 'isolation_level'
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4878
diff changeset
120 db2.commit()
05c857e5dbed New rdbms configuration option 'isolation_level'
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4878
diff changeset
121 db2.close()
05c857e5dbed New rdbms configuration option 'isolation_level'
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4878
diff changeset
122 self.db = self.tracker.open('admin')
05c857e5dbed New rdbms configuration option 'isolation_level'
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4878
diff changeset
123 journal = self.db.getjournal('issue', id)
05c857e5dbed New rdbms configuration option 'isolation_level'
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4878
diff changeset
124 for n, line in enumerate(journal):
05c857e5dbed New rdbms configuration option 'isolation_level'
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4878
diff changeset
125 self.assertEqual(line[4], expected_journal[n])
05c857e5dbed New rdbms configuration option 'isolation_level'
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4878
diff changeset
126
05c857e5dbed New rdbms configuration option 'isolation_level'
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4878
diff changeset
127 def testConcurrentReadCommitted(self):
05c857e5dbed New rdbms configuration option 'isolation_level'
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4878
diff changeset
128 expected_journal = [
05c857e5dbed New rdbms configuration option 'isolation_level'
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4878
diff changeset
129 {}, {'title': 'initial value'}, {'title': 'initial value'}
05c857e5dbed New rdbms configuration option 'isolation_level'
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4878
diff changeset
130 ]
05c857e5dbed New rdbms configuration option 'isolation_level'
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4878
diff changeset
131 self._test_journal(expected_journal)
05c857e5dbed New rdbms configuration option 'isolation_level'
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4878
diff changeset
132
05c857e5dbed New rdbms configuration option 'isolation_level'
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4878
diff changeset
133 def testConcurrentRepeatableRead(self):
05c857e5dbed New rdbms configuration option 'isolation_level'
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4878
diff changeset
134 self.tracker.config.RDBMS_ISOLATION_LEVEL='repeatable read'
05c857e5dbed New rdbms configuration option 'isolation_level'
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4878
diff changeset
135 exc = self.module.TransactionRollbackError
05c857e5dbed New rdbms configuration option 'isolation_level'
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4878
diff changeset
136 self.assertRaises(exc, self._test_journal, [])
05c857e5dbed New rdbms configuration option 'isolation_level'
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4878
diff changeset
137
5033
63c79c0992ae Update tests to work with py.test
John Kristensen <john@jerrykan.com>
parents: 4887
diff changeset
138
5036
380d8d8b30a3 Replace existing run_tests.py script with a pytest script
John Kristensen <john@jerrykan.com>
parents: 5033
diff changeset
139 @skip_postgresql
5033
63c79c0992ae Update tests to work with py.test
John Kristensen <john@jerrykan.com>
parents: 4887
diff changeset
140 class postgresqlHTMLItemTest(postgresqlOpener, HTMLItemTest,
63c79c0992ae Update tests to work with py.test
John Kristensen <john@jerrykan.com>
parents: 4887
diff changeset
141 unittest.TestCase):
4878
f6e76a03b502 HTML* classes for cgi are now all new-style
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4570
diff changeset
142 backend = 'postgresql'
f6e76a03b502 HTML* classes for cgi are now all new-style
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4570
diff changeset
143 def setUp(self):
f6e76a03b502 HTML* classes for cgi are now all new-style
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4570
diff changeset
144 postgresqlOpener.setUp(self)
f6e76a03b502 HTML* classes for cgi are now all new-style
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4570
diff changeset
145 HTMLItemTest.setUp(self)
f6e76a03b502 HTML* classes for cgi are now all new-style
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4570
diff changeset
146
f6e76a03b502 HTML* classes for cgi are now all new-style
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4570
diff changeset
147 def tearDown(self):
f6e76a03b502 HTML* classes for cgi are now all new-style
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4570
diff changeset
148 HTMLItemTest.tearDown(self)
f6e76a03b502 HTML* classes for cgi are now all new-style
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4570
diff changeset
149 postgresqlOpener.tearDown(self)
f6e76a03b502 HTML* classes for cgi are now all new-style
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4570
diff changeset
150
5033
63c79c0992ae Update tests to work with py.test
John Kristensen <john@jerrykan.com>
parents: 4887
diff changeset
151
5036
380d8d8b30a3 Replace existing run_tests.py script with a pytest script
John Kristensen <john@jerrykan.com>
parents: 5033
diff changeset
152 @skip_postgresql
5033
63c79c0992ae Update tests to work with py.test
John Kristensen <john@jerrykan.com>
parents: 4887
diff changeset
153 class postgresqlFilterCacheTest(postgresqlOpener, FilterCacheTest,
63c79c0992ae Update tests to work with py.test
John Kristensen <john@jerrykan.com>
parents: 4887
diff changeset
154 unittest.TestCase):
4472
34dce76bb202 Multilink fixes and optimizations:
Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net>
parents: 4448
diff changeset
155 backend = 'postgresql'
34dce76bb202 Multilink fixes and optimizations:
Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net>
parents: 4448
diff changeset
156 def setUp(self):
34dce76bb202 Multilink fixes and optimizations:
Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net>
parents: 4448
diff changeset
157 postgresqlOpener.setUp(self)
34dce76bb202 Multilink fixes and optimizations:
Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net>
parents: 4448
diff changeset
158 FilterCacheTest.setUp(self)
34dce76bb202 Multilink fixes and optimizations:
Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net>
parents: 4448
diff changeset
159
34dce76bb202 Multilink fixes and optimizations:
Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net>
parents: 4448
diff changeset
160 def tearDown(self):
34dce76bb202 Multilink fixes and optimizations:
Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net>
parents: 4448
diff changeset
161 FilterCacheTest.tearDown(self)
34dce76bb202 Multilink fixes and optimizations:
Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net>
parents: 4448
diff changeset
162 postgresqlOpener.tearDown(self)
34dce76bb202 Multilink fixes and optimizations:
Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net>
parents: 4448
diff changeset
163
5033
63c79c0992ae Update tests to work with py.test
John Kristensen <john@jerrykan.com>
parents: 4887
diff changeset
164
5036
380d8d8b30a3 Replace existing run_tests.py script with a pytest script
John Kristensen <john@jerrykan.com>
parents: 5033
diff changeset
165 @skip_postgresql
5033
63c79c0992ae Update tests to work with py.test
John Kristensen <john@jerrykan.com>
parents: 4887
diff changeset
166 class postgresqlSchemaTest(postgresqlOpener, SchemaTest, unittest.TestCase):
1906
f255363e6d97 PostgreSQL backend lands.
Richard Jones <richard@users.sourceforge.net>
parents: 1877
diff changeset
167 def setUp(self):
f255363e6d97 PostgreSQL backend lands.
Richard Jones <richard@users.sourceforge.net>
parents: 1877
diff changeset
168 postgresqlOpener.setUp(self)
f255363e6d97 PostgreSQL backend lands.
Richard Jones <richard@users.sourceforge.net>
parents: 1877
diff changeset
169 SchemaTest.setUp(self)
f255363e6d97 PostgreSQL backend lands.
Richard Jones <richard@users.sourceforge.net>
parents: 1877
diff changeset
170
f255363e6d97 PostgreSQL backend lands.
Richard Jones <richard@users.sourceforge.net>
parents: 1877
diff changeset
171 def tearDown(self):
f255363e6d97 PostgreSQL backend lands.
Richard Jones <richard@users.sourceforge.net>
parents: 1877
diff changeset
172 SchemaTest.tearDown(self)
f255363e6d97 PostgreSQL backend lands.
Richard Jones <richard@users.sourceforge.net>
parents: 1877
diff changeset
173 postgresqlOpener.tearDown(self)
1873
f63aa57386b0 Backend improvements.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
174
5033
63c79c0992ae Update tests to work with py.test
John Kristensen <john@jerrykan.com>
parents: 4887
diff changeset
175
5036
380d8d8b30a3 Replace existing run_tests.py script with a pytest script
John Kristensen <john@jerrykan.com>
parents: 5033
diff changeset
176 @skip_postgresql
5033
63c79c0992ae Update tests to work with py.test
John Kristensen <john@jerrykan.com>
parents: 4887
diff changeset
177 class postgresqlClassicInitTest(postgresqlOpener, ClassicInitTest,
63c79c0992ae Update tests to work with py.test
John Kristensen <john@jerrykan.com>
parents: 4887
diff changeset
178 unittest.TestCase):
1873
f63aa57386b0 Backend improvements.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
179 backend = 'postgresql'
1906
f255363e6d97 PostgreSQL backend lands.
Richard Jones <richard@users.sourceforge.net>
parents: 1877
diff changeset
180 def setUp(self):
f255363e6d97 PostgreSQL backend lands.
Richard Jones <richard@users.sourceforge.net>
parents: 1877
diff changeset
181 postgresqlOpener.setUp(self)
f255363e6d97 PostgreSQL backend lands.
Richard Jones <richard@users.sourceforge.net>
parents: 1877
diff changeset
182 ClassicInitTest.setUp(self)
f255363e6d97 PostgreSQL backend lands.
Richard Jones <richard@users.sourceforge.net>
parents: 1877
diff changeset
183
f255363e6d97 PostgreSQL backend lands.
Richard Jones <richard@users.sourceforge.net>
parents: 1877
diff changeset
184 def tearDown(self):
f255363e6d97 PostgreSQL backend lands.
Richard Jones <richard@users.sourceforge.net>
parents: 1877
diff changeset
185 ClassicInitTest.tearDown(self)
f255363e6d97 PostgreSQL backend lands.
Richard Jones <richard@users.sourceforge.net>
parents: 1877
diff changeset
186 postgresqlOpener.tearDown(self)
1873
f63aa57386b0 Backend improvements.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
187
5033
63c79c0992ae Update tests to work with py.test
John Kristensen <john@jerrykan.com>
parents: 4887
diff changeset
188
2082
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents: 2075
diff changeset
189 from session_common import RDBMSTest
5036
380d8d8b30a3 Replace existing run_tests.py script with a pytest script
John Kristensen <john@jerrykan.com>
parents: 5033
diff changeset
190 @skip_postgresql
5033
63c79c0992ae Update tests to work with py.test
John Kristensen <john@jerrykan.com>
parents: 4887
diff changeset
191 class postgresqlSessionTest(postgresqlOpener, RDBMSTest, unittest.TestCase):
2082
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents: 2075
diff changeset
192 def setUp(self):
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents: 2075
diff changeset
193 postgresqlOpener.setUp(self)
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents: 2075
diff changeset
194 RDBMSTest.setUp(self)
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents: 2075
diff changeset
195 def tearDown(self):
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents: 2075
diff changeset
196 RDBMSTest.tearDown(self)
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents: 2075
diff changeset
197 postgresqlOpener.tearDown(self)
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents: 2075
diff changeset
198
2682
93c58a68061b rdbms settings are now common for all backends.
Alexander Smishlajev <a1s@users.sourceforge.net>
parents: 2358
diff changeset
199 # vim: set et sts=4 sw=4 :

Roundup Issue Tracker: http://roundup-tracker.org/