File tree 4 files changed +12
-7
lines changed
tests/unit_tests/connections/insert
4 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -52,8 +52,9 @@ async def test_insert_record_id_result_error(self):
52
52
53
53
with self .assertRaises (Exception ) as context :
54
54
_ = await self .connection .insert (record_id , self .insert_data )
55
+ e = str (context .exception )
55
56
self .assertEqual (
56
- "There was a problem with the database: Can not execute INSERT statement using value ' user:tobie' " in str ( context . exception ) ,
57
+ "There was a problem with the database: Can not execute INSERT statement using value" in e and " user:tobie" in e ,
57
58
True
58
59
)
59
60
await self .connection .query ("DELETE user;" )
Original file line number Diff line number Diff line change @@ -53,8 +53,9 @@ async def test_insert_record_id_result_error(self):
53
53
54
54
with self .assertRaises (Exception ) as context :
55
55
_ = await self .connection .insert (record_id , self .insert_data )
56
+ e = str (context .exception )
56
57
self .assertEqual (
57
- "There was a problem with the database: Can not execute INSERT statement using value ' user:tobie' " in str ( context . exception ) ,
58
+ "There was a problem with the database: Can not execute INSERT statement using value" in e and " user:tobie" in e ,
58
59
True
59
60
)
60
61
await self .connection .query ("DELETE user;" )
Original file line number Diff line number Diff line change @@ -57,8 +57,10 @@ def test_insert_record_id_result_error(self):
57
57
58
58
with self .assertRaises (Exception ) as context :
59
59
_ = self .connection .insert (record_id , self .insert_data )
60
- self .assertTrue (
61
- "There was a problem with the database: Can not execute INSERT statement using value 'user:tobie'" in str (context .exception )
60
+ e = str (context .exception )
61
+ self .assertEqual (
62
+ "There was a problem with the database: Can not execute INSERT statement using value" in e and "user:tobie" in e ,
63
+ True
62
64
)
63
65
self .connection .query ("DELETE user;" )
64
66
Original file line number Diff line number Diff line change @@ -56,9 +56,10 @@ def test_insert_record_id_result_error(self):
56
56
57
57
with self .assertRaises (Exception ) as context :
58
58
_ = self .connection .insert (record_id , self .insert_data )
59
- self .assertTrue (
60
- "There was a problem with the database: Can not execute INSERT statement using value 'user:tobie'"
61
- in str (context .exception )
59
+ e = str (context .exception )
60
+ self .assertEqual (
61
+ "There was a problem with the database: Can not execute INSERT statement using value" in e and "user:tobie" in e ,
62
+ True
62
63
)
63
64
64
65
You can’t perform that action at this time.
0 commit comments