File tree 3 files changed +6
-10
lines changed
3 files changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -185,10 +185,6 @@ pub mod tests_postgres {
185
185
pub fn new ( name : String , pool : DbPool ) -> Self {
186
186
Self { name, pool }
187
187
}
188
-
189
- pub fn get_pool ( & self ) -> deadpool_postgres:: Pool < NoTls > {
190
- self . pool . clone ( )
191
- }
192
188
}
193
189
194
190
impl Deref for Database {
Original file line number Diff line number Diff line change @@ -61,18 +61,18 @@ mod test {
61
61
async fn it_inserts_and_fetches_campaign ( ) {
62
62
let database = DATABASE_POOL . get ( ) . await . expect ( "Should get a DB pool" ) ;
63
63
64
- setup_test_migrations ( database. get_pool ( ) )
64
+ setup_test_migrations ( database. pool . clone ( ) )
65
65
. await
66
66
. expect ( "Migrations should succeed" ) ;
67
67
68
68
let campaign_for_testing = DUMMY_CAMPAIGN . clone ( ) ;
69
- let is_inserted = insert_campaign ( & database. get_pool ( ) , & campaign_for_testing)
69
+ let is_inserted = insert_campaign ( & database. pool , & campaign_for_testing)
70
70
. await
71
71
. expect ( "Should succeed" ) ;
72
72
73
73
assert ! ( is_inserted) ;
74
74
75
- let fetched_campaign = fetch_campaign ( database. get_pool ( ) , & campaign_for_testing)
75
+ let fetched_campaign = fetch_campaign ( database. pool . clone ( ) , & campaign_for_testing)
76
76
. await
77
77
. expect ( "Should fetch successfully" ) ;
78
78
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ mod test {
62
62
async fn it_inserts_and_fetches_spendable ( ) {
63
63
let database = DATABASE_POOL . get ( ) . await . expect ( "Should get a DB pool" ) ;
64
64
65
- setup_test_migrations ( database. get_pool ( ) )
65
+ setup_test_migrations ( database. pool . clone ( ) )
66
66
. await
67
67
. expect ( "Migrations should succeed" ) ;
68
68
@@ -74,14 +74,14 @@ mod test {
74
74
still_on_create2 : UnifiedNum :: from ( 500_000 ) ,
75
75
} ,
76
76
} ;
77
- let is_inserted = insert_spendable ( database. get_pool ( ) , & spendable)
77
+ let is_inserted = insert_spendable ( database. pool . clone ( ) , & spendable)
78
78
. await
79
79
. expect ( "Should succeed" ) ;
80
80
81
81
assert ! ( is_inserted) ;
82
82
83
83
let fetched_spendable = fetch_spendable (
84
- database. get_pool ( ) ,
84
+ database. pool . clone ( ) ,
85
85
& spendable. spender ,
86
86
& spendable. channel . id ( ) ,
87
87
)
You can’t perform that action at this time.
0 commit comments