Skip to content

Handle of Composed object from psycopg2 #1040

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed

Handle of Composed object from psycopg2 #1040

wants to merge 3 commits into from

Conversation

stephane
Copy link

@codecov
Copy link

codecov bot commented Jan 30, 2018

Codecov Report

Merging #1040 into master will increase coverage by 0.04%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1040      +/-   ##
==========================================
+ Coverage   84.29%   84.33%   +0.04%     
==========================================
  Files          24       24              
  Lines        1318     1296      -22     
  Branches      178      176       -2     
==========================================
- Hits         1111     1093      -18     
+ Misses        157      155       -2     
+ Partials       50       48       -2
Impacted Files Coverage Δ
debug_toolbar/panels/sql/tracking.py 83.83% <ø> (ø) ⬆️
debug_toolbar/panels/timer.py 89.13% <0%> (-1.26%) ⬇️
debug_toolbar/panels/sql/panel.py 63.75% <0%> (-1.18%) ⬇️
debug_toolbar/panels/cache.py 80.35% <0%> (-0.84%) ⬇️
debug_toolbar/toolbar.py 85.71% <0%> (-0.21%) ⬇️
debug_toolbar/panels/profiling.py 91.07% <0%> (+1.5%) ⬆️
debug_toolbar/apps.py 94.59% <0%> (+4.85%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3725cec...0818ec7. Read the comment docs.

@jdufresne
Copy link
Contributor

Would it be possible to add a test?

@camilonova
Copy link
Contributor

@stephane can you add a test?

@stephane
Copy link
Author

Added but now running tests requires a PostgreSQL server.

@camilonova
Copy link
Contributor

@aaugustin any ideas how to support this?

@aaugustin
Copy link
Contributor

Provide a separate settings file that uses PostgreSQL and skip the test if not running with PostgreSQL. There are examples of doing this in Django itself.

@matthiask
Copy link
Member

One job per build runs on PostgreSQL now: 57053f7

There is already one test in the testsuite which only runs on PostgreSQL: https://github.com/jazzband/django-debug-toolbar/blob/e11a40259fece146ffb840557ddc03ae263f35f1/tests/panels/test_sql.py#L140

Fix for:
  'is_select': sql.lower().strip().startswith('select'),
   AttributeError: 'Composed' object has no attribute 'lower'

http://initd.org/psycopg/docs/sql.html#psycopg2.sql.Composed
- add dependency on psycopg2
- requires PostgreSQL server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants