Skip to content

Commit

Permalink
fix: Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
untitaker committed Sep 19, 2019
1 parent 57c18dc commit cdb71e5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
10 changes: 2 additions & 8 deletions tests/integrations/django/test_basic.py
Expand Up @@ -188,7 +188,6 @@ def test_sql_queries(sentry_init, capture_events, with_integration):
crumb = event["breadcrumbs"][-1]

assert crumb["message"] == "SELECT count(*) FROM people_person WHERE foo = %s"
assert crumb["data"]["db.params"] == [123]


@pytest.mark.django_db
Expand Down Expand Up @@ -216,7 +215,6 @@ def test_sql_dict_query_params(sentry_init, capture_events):
assert crumb["message"] == (
"SELECT count(*) FROM people_person WHERE foo = %(my_foo)s"
)
assert crumb["data"]["db.params"] == {"my_foo": 10}


@pytest.mark.parametrize(
Expand Down Expand Up @@ -249,7 +247,6 @@ def test_sql_psycopg2_string_composition(sentry_init, capture_events, query):
event, = events
crumb = event["breadcrumbs"][-1]
assert crumb["message"] == ('SELECT %(my_param)s FROM "foobar"')
assert crumb["data"]["db.params"] == {"my_param": 10}


@pytest.mark.django_db
Expand Down Expand Up @@ -288,16 +285,13 @@ def test_sql_psycopg2_placeholders(sentry_init, capture_events):
assert event["breadcrumbs"][-2:] == [
{
"category": "query",
"data": {"db.paramstyle": "format"},
"data": {},
"message": "create table my_test_table (foo text, bar date)",
"type": "default",
},
{
"category": "query",
"data": {
"db.params": {"first_var": "fizz", "second_var": "not a date"},
"db.paramstyle": "format",
},
"data": {},
"message": 'insert into my_test_table ("foo", "bar") values (%(first_var)s, '
"%(second_var)s)",
"type": "default",
Expand Down
4 changes: 2 additions & 2 deletions tests/integrations/sqlalchemy/test_sqlalchemy.py
Expand Up @@ -48,13 +48,13 @@ class Address(Base):
assert event["breadcrumbs"][-2:] == [
{
"category": "query",
"data": {"db.params": ["Bob"], "db.paramstyle": "qmark"},
"data": {},
"message": "INSERT INTO person (name) VALUES (?)",
"type": "default",
},
{
"category": "query",
"data": {"db.params": [1, 0], "db.paramstyle": "qmark"},
"data": {},
"message": "SELECT person.id AS person_id, person.name AS person_name \n"
"FROM person\n"
" LIMIT ? OFFSET ?",
Expand Down

0 comments on commit cdb71e5

Please sign in to comment.