Skip to content

Commit

Permalink
Bug 1091643 - Add tests for SQL LIKE escaping of search_term
Browse files Browse the repository at this point in the history
Test that we are treating the search term literally in the LIKE
statement, and so have correctly escaped any underscores, percent signs
or escape symbols.
  • Loading branch information
Ed Morley committed Nov 10, 2014
1 parent b2ffa4d commit 93e0c98
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/etl/test_bugzilla.py
Expand Up @@ -39,8 +39,8 @@ def test_bz_api_process(mock_extract, refdata):
refdata.disconnect()

# the number of rows inserted should equal to the number of bugs
assert len(row_data) == 12
assert len(row_data) == 13

# test that a second ingestion of the same bugs doesn't insert new rows
process.run()
assert len(row_data) == 12
assert len(row_data) == 13
12 changes: 12 additions & 0 deletions tests/model/derived/test_refdata.py
Expand Up @@ -464,6 +464,18 @@ def test_update_bugscache(refdata, sample_bugs):
"test_switch_frame.py TestSwitchFrame.test_should_be_able_to_carry_on_working_if_the_frame_is_deleted",
[1054669, 1078237]
),
(
"should not be match_d",
[]
),
(
"should not be match%d",
[]
),
(
"should not be matche=d",
[]
),
)


Expand Down
12 changes: 12 additions & 0 deletions tests/sample_data/bug_list.json
Expand Up @@ -145,6 +145,18 @@
"resolution": "",
"op_sys": "Windows 7",
"last_change_time": "2014-10-29T20:57:46"
},
{
"status": "NEW",
"id": 1,
"summary": "This bug should not be matched",
"cf_crash_signature": "",
"keywords": [
"intermittent-failure"
],
"resolution": "",
"op_sys": "Windows 7",
"last_change_time": "2014-10-29T20:57:46"
}
]
}

0 comments on commit 93e0c98

Please sign in to comment.