author | Radek Brich <brich.radek@ifortuna.cz> |
Tue, 06 May 2014 18:37:41 +0200 | |
changeset 100 | d6088dba8fea |
parent 75 | 39f777341db4 |
child 104 | d8ff52a0390f |
permissions | -rw-r--r-- |
49
08e4dfe1b0cb
Add test for MyManager (enable only when MySQLdb is available). Configure tests using pgtoolkit.conf (same as used by other executables).
Radek Brich <radek.brich@devl.cz>
parents:
22
diff
changeset
|
1 |
TESTING |
08e4dfe1b0cb
Add test for MyManager (enable only when MySQLdb is available). Configure tests using pgtoolkit.conf (same as used by other executables).
Radek Brich <radek.brich@devl.cz>
parents:
22
diff
changeset
|
2 |
======= |
22 | 3 |
|
49
08e4dfe1b0cb
Add test for MyManager (enable only when MySQLdb is available). Configure tests using pgtoolkit.conf (same as used by other executables).
Radek Brich <radek.brich@devl.cz>
parents:
22
diff
changeset
|
4 |
All test should work at least with Python 2.7 and 3.2 |
22 | 5 |
|
6 |
||
7 |
How to test |
|
8 |
----------- |
|
9 |
||
49
08e4dfe1b0cb
Add test for MyManager (enable only when MySQLdb is available). Configure tests using pgtoolkit.conf (same as used by other executables).
Radek Brich <radek.brich@devl.cz>
parents:
22
diff
changeset
|
10 |
1. copy pgtoolkit.conf.example to pgtoolkit.conf, modify it so it points to your test database |
22 | 11 |
|
49
08e4dfe1b0cb
Add test for MyManager (enable only when MySQLdb is available). Configure tests using pgtoolkit.conf (same as used by other executables).
Radek Brich <radek.brich@devl.cz>
parents:
22
diff
changeset
|
12 |
2. create test tables using sql/tests.sql |
22 | 13 |
|
49
08e4dfe1b0cb
Add test for MyManager (enable only when MySQLdb is available). Configure tests using pgtoolkit.conf (same as used by other executables).
Radek Brich <radek.brich@devl.cz>
parents:
22
diff
changeset
|
14 |
3. run tests.py |
22 | 15 |
|
75
39f777341db4
MyManager: Add Cursor.mogrify(). Fix query logging. Update tests.
Radek Brich <radek.brich@devl.cz>
parents:
49
diff
changeset
|
16 |
|
39f777341db4
MyManager: Add Cursor.mogrify(). Fix query logging. Update tests.
Radek Brich <radek.brich@devl.cz>
parents:
49
diff
changeset
|
17 |
PostgreSQL |
39f777341db4
MyManager: Add Cursor.mogrify(). Fix query logging. Update tests.
Radek Brich <radek.brich@devl.cz>
parents:
49
diff
changeset
|
18 |
---------- |
39f777341db4
MyManager: Add Cursor.mogrify(). Fix query logging. Update tests.
Radek Brich <radek.brich@devl.cz>
parents:
49
diff
changeset
|
19 |
|
39f777341db4
MyManager: Add Cursor.mogrify(). Fix query logging. Update tests.
Radek Brich <radek.brich@devl.cz>
parents:
49
diff
changeset
|
20 |
CREATE ROLE test LOGIN PASSWORD 'test'; |
39f777341db4
MyManager: Add Cursor.mogrify(). Fix query logging. Update tests.
Radek Brich <radek.brich@devl.cz>
parents:
49
diff
changeset
|
21 |
|
39f777341db4
MyManager: Add Cursor.mogrify(). Fix query logging. Update tests.
Radek Brich <radek.brich@devl.cz>
parents:
49
diff
changeset
|
22 |
CREATE DATABASE test; |
39f777341db4
MyManager: Add Cursor.mogrify(). Fix query logging. Update tests.
Radek Brich <radek.brich@devl.cz>
parents:
49
diff
changeset
|
23 |
\c test |
39f777341db4
MyManager: Add Cursor.mogrify(). Fix query logging. Update tests.
Radek Brich <radek.brich@devl.cz>
parents:
49
diff
changeset
|
24 |
\i sql/tests.sql |
39f777341db4
MyManager: Add Cursor.mogrify(). Fix query logging. Update tests.
Radek Brich <radek.brich@devl.cz>
parents:
49
diff
changeset
|
25 |
|
39f777341db4
MyManager: Add Cursor.mogrify(). Fix query logging. Update tests.
Radek Brich <radek.brich@devl.cz>
parents:
49
diff
changeset
|
26 |
|
39f777341db4
MyManager: Add Cursor.mogrify(). Fix query logging. Update tests.
Radek Brich <radek.brich@devl.cz>
parents:
49
diff
changeset
|
27 |
MySQL |
39f777341db4
MyManager: Add Cursor.mogrify(). Fix query logging. Update tests.
Radek Brich <radek.brich@devl.cz>
parents:
49
diff
changeset
|
28 |
----- |
39f777341db4
MyManager: Add Cursor.mogrify(). Fix query logging. Update tests.
Radek Brich <radek.brich@devl.cz>
parents:
49
diff
changeset
|
29 |
|
39f777341db4
MyManager: Add Cursor.mogrify(). Fix query logging. Update tests.
Radek Brich <radek.brich@devl.cz>
parents:
49
diff
changeset
|
30 |
CREATE USER 'test'@'%' IDENTIFIED BY 'test'; |
39f777341db4
MyManager: Add Cursor.mogrify(). Fix query logging. Update tests.
Radek Brich <radek.brich@devl.cz>
parents:
49
diff
changeset
|
31 |
GRANT all ON test.* TO 'test'@'%'; |
39f777341db4
MyManager: Add Cursor.mogrify(). Fix query logging. Update tests.
Radek Brich <radek.brich@devl.cz>
parents:
49
diff
changeset
|
32 |
|
39f777341db4
MyManager: Add Cursor.mogrify(). Fix query logging. Update tests.
Radek Brich <radek.brich@devl.cz>
parents:
49
diff
changeset
|
33 |
CREATE DATABASE test; |
39f777341db4
MyManager: Add Cursor.mogrify(). Fix query logging. Update tests.
Radek Brich <radek.brich@devl.cz>
parents:
49
diff
changeset
|
34 |
USE test; |
39f777341db4
MyManager: Add Cursor.mogrify(). Fix query logging. Update tests.
Radek Brich <radek.brich@devl.cz>
parents:
49
diff
changeset
|
35 |
|
39f777341db4
MyManager: Add Cursor.mogrify(). Fix query logging. Update tests.
Radek Brich <radek.brich@devl.cz>
parents:
49
diff
changeset
|
36 |
CREATE TABLE test |
39f777341db4
MyManager: Add Cursor.mogrify(). Fix query logging. Update tests.
Radek Brich <radek.brich@devl.cz>
parents:
49
diff
changeset
|
37 |
( |
39f777341db4
MyManager: Add Cursor.mogrify(). Fix query logging. Update tests.
Radek Brich <radek.brich@devl.cz>
parents:
49
diff
changeset
|
38 |
id INT NOT NULL AUTO_INCREMENT, |
39f777341db4
MyManager: Add Cursor.mogrify(). Fix query logging. Update tests.
Radek Brich <radek.brich@devl.cz>
parents:
49
diff
changeset
|
39 |
name TEXT, |
39f777341db4
MyManager: Add Cursor.mogrify(). Fix query logging. Update tests.
Radek Brich <radek.brich@devl.cz>
parents:
49
diff
changeset
|
40 |
PRIMARY KEY (id) |
39f777341db4
MyManager: Add Cursor.mogrify(). Fix query logging. Update tests.
Radek Brich <radek.brich@devl.cz>
parents:
49
diff
changeset
|
41 |
) |
39f777341db4
MyManager: Add Cursor.mogrify(). Fix query logging. Update tests.
Radek Brich <radek.brich@devl.cz>
parents:
49
diff
changeset
|
42 |
ENGINE=InnoDB CHARSET=utf8; |
39f777341db4
MyManager: Add Cursor.mogrify(). Fix query logging. Update tests.
Radek Brich <radek.brich@devl.cz>
parents:
49
diff
changeset
|
43 |