For unit testing, you can mock some of your classes (db connection, query, parameter binder). For larger functional tests you can use a real connection to a test db. Worked well for two libpq C++ wrappers I did a few years back (one for Qt, another for C++/STL).
With regards to libpqxx - it still does not support binary libpq v3 protocol, which in some cases (e.g. import/export large amounts binary data) may be a bottleneck. Other than this, it's pretty straightforward to use and is quite enjoyable.