From 2adc2bf0beb051f20492b138c57fae399a78b280 Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Sun, 21 Nov 2021 17:39:42 +0100 Subject: [PATCH] Check that project creation via the API doesn't required a captcha. (#926) Fixes #922 --- ihatemoney/tests/main_test.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ihatemoney/tests/main_test.py b/ihatemoney/tests/main_test.py index 69392267..3efc4bf2 100644 --- a/ihatemoney/tests/main_test.py +++ b/ihatemoney/tests/main_test.py @@ -285,6 +285,19 @@ class CaptchaTestCase(IhatemoneyTestCase): ) assert len(models.Project.query.all()) == 1 + def test_api_project_creation_does_not_need_captcha(self): + resp = self.client.post( + "/api/projects", + data={ + "name": "raclette", + "id": "raclette", + "password": "raclette", + "contact_email": "raclette@notmyidea.org", + }, + ) + self.assertTrue(resp.status, 201) + assert len(models.Project.query.all()) == 1 + class TestCurrencyConverter(unittest.TestCase): converter = CurrencyConverter()