15 lines
496 B
Python
15 lines
496 B
Python
# -*- coding: utf-8 -*-
|
|
from authentic2_auth_fc.models import FcAccount
|
|
|
|
|
|
def test_api_fc_unlink(app, admin, user_cartman):
|
|
url = '/api/users/%s/fc-unlink/' % user_cartman.uuid
|
|
# test unauthorized caller
|
|
app.delete(url, status=401)
|
|
# test unauthorized method
|
|
app.authorization = ('Basic', (admin.username, admin.username))
|
|
app.get(url, status=405)
|
|
# test success
|
|
app.delete(url, status=204)
|
|
assert FcAccount.objects.filter(user=user_cartman).exists() is False
|