mirror of
https://github.com/peeringdb/peeringdb.git
synced 2024-05-11 05:55:09 +00:00
handle bogon asns (#419)
This commit is contained in:
@@ -3,36 +3,11 @@ from django.contrib.auth import get_user_model
|
||||
from django.conf import settings
|
||||
|
||||
|
||||
from util import ClientCase
|
||||
from util import SettingsCase
|
||||
from peeringdb_server import signals, models, serializers
|
||||
from peeringdb_server import settings as pdb_settings
|
||||
|
||||
|
||||
class SettingsCase(ClientCase):
|
||||
|
||||
"""
|
||||
Since we read settings from peeringdb_server.settings
|
||||
we can't use the `settings` fixture from pytest-django
|
||||
|
||||
This class instead does something similar for peeringdb_server.settings,
|
||||
where it will override settings specified and then reset after test case
|
||||
is finished
|
||||
"""
|
||||
|
||||
settings = {}
|
||||
|
||||
@classmethod
|
||||
def setUp(cls):
|
||||
cls._restore = {}
|
||||
for k,v in cls.settings.items():
|
||||
cls._restore[k] = getattr(pdb_settings, k)
|
||||
setattr(pdb_settings, k, v)
|
||||
|
||||
@classmethod
|
||||
def tearDown(cls):
|
||||
for k,v in cls._restore.items():
|
||||
setattr(pdb_settings, k, v)
|
||||
|
||||
|
||||
class TestAutoVerifyUser(SettingsCase):
|
||||
settings = {"AUTO_VERIFY_USERS":True}
|
||||
|
||||
Reference in New Issue
Block a user