mirror of
https://github.com/caronc/apprise-api.git
synced 2025-08-14 08:48:23 +02:00
APPRISE_CONFIG_LOCK switch added for extra security (#57)
This commit is contained in:
@ -23,6 +23,7 @@
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
# THE SOFTWARE.
|
||||
from django.test import SimpleTestCase
|
||||
from django.test.utils import override_settings
|
||||
from unittest.mock import patch
|
||||
|
||||
|
||||
@ -35,6 +36,18 @@ class DelTests(SimpleTestCase):
|
||||
response = self.client.get('/del/**invalid-key**')
|
||||
assert response.status_code == 404
|
||||
|
||||
@override_settings(APPRISE_CONFIG_LOCK=True)
|
||||
def test_del_with_lock(self):
|
||||
"""
|
||||
Test deleting a configuration by URLs with lock set won't work
|
||||
"""
|
||||
# our key to use
|
||||
key = 'test_delete_with_lock'
|
||||
|
||||
# We simply do not have permission to do so
|
||||
response = self.client.post('/del/{}'.format(key))
|
||||
assert response.status_code == 403
|
||||
|
||||
def test_del_post(self):
|
||||
"""
|
||||
Test DEL POST
|
||||
|
Reference in New Issue
Block a user