aboutsummaryrefslogtreecommitdiff
path: root/tests/unit/db
diff options
context:
space:
mode:
authorBonfaceKilz2021-06-03 21:38:58 +0300
committerzsloan2021-06-18 22:08:04 +0000
commit4c9bbe6d4229b79a1bc62cf2f641fbc4c4f00abc (patch)
treecbc3ffb79d91d8231cadeaf5d07a549f34ac78cf /tests/unit/db
parentde834809dbf5f054a5f75c35dbee653cac8311f3 (diff)
downloadgenenetwork3-4c9bbe6d4229b79a1bc62cf2f641fbc4c4f00abc.tar.gz
Use prepared statements for UPDATE sql function
Diffstat (limited to 'tests/unit/db')
-rw-r--r--tests/unit/db/test_phenotypes.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/tests/unit/db/test_phenotypes.py b/tests/unit/db/test_phenotypes.py
index fdeca5e..21eb757 100644
--- a/tests/unit/db/test_phenotypes.py
+++ b/tests/unit/db/test_phenotypes.py
@@ -37,12 +37,10 @@ class TestPhenotypes(TestCase):
where=Phenotype(id_=1, owner="Rob")), 1)
cursor.execute.assert_called_once_with(
"UPDATE Phenotype SET "
- "Pre_publication_description = "
- "'Test Pre Pub', "
- "Post_publication_description = "
- "'Test Post Pub', Submitter = 'Rob' "
- "WHERE id = '1' AND Owner = 'Rob'"
- )
+ "Pre_publication_description = %s, "
+ "Post_publication_description = %s, "
+ "Submitter = %s WHERE id = %s AND Owner = %s",
+ ('Test Pre Pub', 'Test Post Pub', 'Rob', 1, 'Rob'))
def test_fetch_phenotype(self):
"""Test that a single phenotype is fetched properly