about summary refs log tree commit diff
path: root/tests/unit/db
diff options
context:
space:
mode:
authorBonfaceKilz2021-06-02 08:22:11 +0300
committerBonfaceKilz2021-06-03 21:58:31 +0300
commit6f138e3c87ca5d2b8277d185258796da88ed839f (patch)
tree532b00965dd34c18f44e97fcc4b8b4686ba7929a /tests/unit/db
parentbd952d23a523a25d014676912cfc1e174435f606 (diff)
downloadgenenetwork3-6f138e3c87ca5d2b8277d185258796da88ed839f.tar.gz
unit: test_phenotypes: Test for multiple "WHERE" clauses
Diffstat (limited to 'tests/unit/db')
-rw-r--r--tests/unit/db/test_phenotypes.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/unit/db/test_phenotypes.py b/tests/unit/db/test_phenotypes.py
index b53db23..fdeca5e 100644
--- a/tests/unit/db/test_phenotypes.py
+++ b/tests/unit/db/test_phenotypes.py
@@ -34,14 +34,14 @@ class TestPhenotypes(TestCase):
                     pre_pub_description="Test Pre Pub",
                     submitter="Rob",
                     post_pub_description="Test Post Pub"),
-                where=Phenotype(id_=1)), 1)
+                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'"
+                "WHERE id = '1' AND Owner = 'Rob'"
             )
 
     def test_fetch_phenotype(self):
@@ -58,12 +58,12 @@ class TestPhenotypes(TestCase):
             cursor.fetchone.return_value = test_data
             phenotype = fetchone(db_mock,
                                  "Phenotype",
-                                 where=Phenotype(id_=35))
+                                 where=Phenotype(id_=35, owner="Rob"))
             self.assertEqual(phenotype.id_, 35)
             self.assertEqual(phenotype.pre_pub_description,
                              "Test pre-publication")
             cursor.execute.assert_called_once_with(
-                "SELECT * FROM Phenotype WHERE id = '35'")
+                "SELECT * FROM Phenotype WHERE id = '35' AND Owner = 'Rob'")
 
     def test_diff_from_dict(self):
         """Test that a correct diff is generated"""