mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2026-02-13 02:55:39 +00:00
feat: def interface to del traffic pattern
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
//! Test utilities
|
||||
use crate::errors::*;
|
||||
use crate::prelude::*;
|
||||
|
||||
/// test all database functions
|
||||
@@ -147,6 +148,16 @@ pub async fn database_works<'a, T: MCDatabase>(
|
||||
tp
|
||||
);
|
||||
|
||||
// delete traffic pattern
|
||||
db.delete_traffic_pattern(p.username, c.key).await.unwrap();
|
||||
assert!(
|
||||
matches!(
|
||||
db.get_traffic_pattern(p.username, c.key).await,
|
||||
Err(DBError::TrafficPatternNotFound)
|
||||
),
|
||||
"deletion successful; traffic pattern no longer exists"
|
||||
);
|
||||
|
||||
// add captcha levels
|
||||
db.add_captcha_levels(p.username, c.key, l).await.unwrap();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user