mirror of
https://github.com/peeringdb/peeringdb.git
synced 2024-05-11 05:55:09 +00:00
* Sorting icon from google material icons #1419 Manual IX-F import request queue can get stuck #1182 IX Object Creation Per Policy #1364 Creating a new network not possible #1401 IX-F Importer: Cosmetic issue with "resolved" emails and double-slashes in URLs after the FQDN #1334 Add a "Delete Affiliation" button/option to the profile #1226 Redis and negative caching #1431 * linting * update gen_docs to use py3.11 * fix issue with api docs schema regen * regen apidoc schema and db schema graph * fix username validation for social media * Add test case for social media validation * linting * tests shouldnt use redis * also fix session cache setup (although not used atm) * linting * all caches to localmemcache during testing --------- Co-authored-by: 20C <code@20c.com> Co-authored-by: Matt Griswold <grizz@20c.com>
42 lines
926 B
Python
42 lines
926 B
Python
import os
|
|
|
|
import pytest
|
|
import pytest_filedata
|
|
|
|
from peeringdb_server.inet import RdapLookup, RdapNotFoundError
|
|
|
|
pytest_filedata.setup(os.path.dirname(__file__))
|
|
|
|
|
|
def pytest_generate_tests(metafunc):
|
|
for fixture in metafunc.fixturenames:
|
|
if fixture.startswith("data_"):
|
|
data = pytest_filedata.get_data(fixture)
|
|
metafunc.parametrize(fixture, list(data.values()), ids=list(data.keys()))
|
|
|
|
|
|
@pytest.fixture
|
|
def rdap():
|
|
return RdapLookup()
|
|
|
|
|
|
@pytest.fixture
|
|
def ixf_importer_user():
|
|
from django.contrib.auth import get_user_model
|
|
|
|
user, created = get_user_model().objects.get_or_create(
|
|
username="ixf_importer",
|
|
email="ixf_importer@localhost",
|
|
)
|
|
return user
|
|
|
|
|
|
@pytest.fixture(autouse=True)
|
|
def cleanup(request):
|
|
"""Cleanup a django cache after each test"""
|
|
|
|
from django.core.cache import caches
|
|
|
|
for name in caches:
|
|
caches[name].clear()
|