summaryrefslogtreecommitdiff
path: root/tests/test_quote.py
Commit message (Collapse)AuthorAgeFilesLines
* Avoid installing tests to site-packagesJon Dufresne2017-12-101-1/+1
| | | | | | | | For library end users, there is no need to install tests alongside the package itself. This keeps the tests available for development without adding extra packages to user's site-packages directory. Reduces the size of the installed package. Avoids accidental execution of test code by an installed package.
* Use relative imports throughout testsJon Dufresne2017-12-101-5/+5
| | | | | | | | | | | | | | The tests relied on Python2 relative import semantics. Python3 changed import semantics to always search sys.path by default. To import using a relative path it must have a leading dot. Forward compatible with newer Pythons. Works towards the goal of moving tests outside of the installed package. For more information, see PEP-328: https://www.python.org/dev/peps/pep-0328/
* Always import the system unittestJon Dufresne2017-12-011-1/+2
| | | | | | | There is no need to import testutils.unittest instead of simply unittest. They are simple aliases. Use system unittest to be more regular, consistent as well as idiomatic with the wider Python community.
* Skipped a couple of tests failing on old dbstest-dinosaursDaniele Varrazzo2017-02-061-0/+1
| | | | I don't even know why - worth investigating.
* Deal consistently with E'' quotes in testsDaniele Varrazzo2017-02-061-2/+2
|
* Fixed tests failing on Python 2.6Daniele Varrazzo2016-12-241-4/+6
|
* Dropped use of b() "macro" and 2to3 fixerDaniele Varrazzo2016-08-151-9/+9
| | | | Just use the b"" strings syntax supported from python 2.6.
* Throw an exception when a NUL character is used as a parameter.Alexander Schrijver2016-07-181-0/+9
|
* Allow adapting bytes using QuotedString on Python 3 tooDaniele Varrazzo2016-07-011-3/+12
| | | | Close #365.
* Fixed encoding tests on Py3Daniele Varrazzo2016-07-011-3/+3
|
* Don't hope to encode stuff in an arbitrary encodingDaniele Varrazzo2016-07-011-3/+9
| | | | | | | | | | | libpq's PQescapeString will use the same encoding it has seen before in a connection (static_client_encoding). So I think I'll leave this feature here for people who know what is doing, but won't really document it as a feature: it can't really work in a generic way (unless adding some disgusting hack like creating a fake connection with the encoding we want to call PQescapeStringConn instead of PQescapeString).
* Test moved to the right module, cleanup, but same problemDaniele Varrazzo2016-07-011-5/+42
|
* Proper unicode handling in quote_ident.Oleksandr Shulgin2015-10-151-1/+12
|
* Add psycopg2.extensions.quote_ident.Oleksandr Shulgin2015-10-141-0/+7
|
* Testing boilerplate unified in a single base classDaniele Varrazzo2013-04-071-16/+3
| | | | | The class makes a connection always available, allows creating new connection and closes everything on tear down.
* Avoid encoding strdup in qstring adapterDaniele Varrazzo2013-04-051-0/+16
| | | | | | Dropped encoding parameter in the constructor: it is used nowhere and not documented. Use directly the connection encoding if available, else the previous latin1 fallback.
* Update all links to PostgreSQL docs to the current version.Marti Raudsepp2012-02-281-2/+2
| | | | I also checked all links and anchors to make sure they're still valid.
* Raise an exception if the libpq fails to decode bytea in hex formatDaniele Varrazzo2011-02-231-0/+4
|
* Merge branch 'python2' into python3Daniele Varrazzo2011-01-101-0/+23
|\ | | | | | | | | | | | | | | | | Conflicts: NEWS-2.3 tests/__init__.py tests/test_lobject.py tests/test_quote.py tests/testutils.py
| * Added license to unit testsDaniele Varrazzo2011-01-091-0/+23
| | | | | | | | As the test suite is now part of the source distribution.
* | Merge branch 'python2' into python3Daniele Varrazzo2011-01-031-1/+1
|\ \ | |/ | | | | | | | | | | | | Conflicts: NEWS-2.3 psycopg/connection_type.c tests/test_connection.py tests/types_basic.py
| * Don't register the unicode typecaster globally during testsDaniele Varrazzo2011-01-031-1/+1
| | | | | | | | It can invalidate the results in further runs in the same process.
* | Several tests ported to Python 3.Daniele Varrazzo2010-12-311-4/+11
| |
* | Added tests to verify a couple of incomplete encodings.Daniele Varrazzo2010-12-311-1/+51
| |
* | Test suite converted into a proper package.Daniele Varrazzo2010-12-211-2/+2
|/ | | | | | Dropped cyclic import from modules to tests: they were only working because a second copy of the package was found in the project dir. Use relative import so that 2to3 can do a good conversion.
* Test cleanup.Daniele Varrazzo2010-11-191-5/+4
| | | | | | Tests pass or fail gracefully on older PostgreSQL versions. If unittest2 is available, skip tests instead of printing warnings.
* 2008-04-21 James Henstridge <james@jamesh.id.au>James Henstridge2008-04-201-2/+11
| | | | | | * tests/test_quote.py (QuotingTestCase.test_unicode): If the server encoding is not UTF8, skip the unicode test and emit a warning.
* 2008-04-21 Jorgen Austvik <Jorgen.Austvik@sun.com>James Henstridge2008-04-201-1/+1
| | | | | | | * tests/*.py: use the DSN constructed in tests/__init__.py. * tests/__init__.py: allow setting the host, port and user for the DSN used by the tests through the environment.
* Added 'make check' target, running all the available tests.Daniele Varrazzo2007-11-111-0/+1
| | | | | | Most of the updates have been provided by James Henstridge. Closes ticket #195.
* Use escape string syntax for string escape if connected to a server Daniele Varrazzo2007-11-111-0/+77
requiring it. Added a connection flag to store whether E''-style quoting is required: this avoids repeated PQparameterStatus() calls. Added a test case to verify correct behavior on strings, unicode and binary data. Tested with PG versions from 7.4 to 8.3b2, with any server 'standard_conforming_strings' setting and with 'PSYCOPG_OWN_QUOTING' too.