1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-03 16:10:26 +00:00

update test

This commit is contained in:
zming
2017-07-15 12:24:52 +08:00
parent 9efb26eca8
commit c0f512aca6
2 changed files with 10 additions and 5 deletions

View File

@@ -1,20 +1,24 @@
import os
import pytest
from django.core.urlresolvers import reverse
from seahub.test_utils import BaseTestCase
from seahub_extra.two_factor import devices_for_user
from seahub_extra.two_factor.models import (StaticDevice, TOTPDevice,
PhoneDevice)
TRAVIS = 'TRAVIS' in os.environ
@pytest.mark.skipif(TRAVIS, reason="")
class TwoFactorAuthViewTest(BaseTestCase):
def setUp(self):
self.login_as(self.admin)
def test_can_disable_two_factor_auth(self):
from seahub_extra.two_factor.models import (StaticDevice, TOTPDevice,
PhoneDevice)
totp = TOTPDevice(user=self.admin, name="", confirmed=1)
totp.save()
from seahub_extra.two_factor import devices_for_user
devices = devices_for_user(self.admin)
i = 0
for device in devices_for_user(self.admin):