nsupdate.info/conftest.py
Thomas Waldmann 4cf62af8ab rename Domain field available_for_everyone to public (so it is not confused with "available" field)
"public" field means that this zone can be used by every user (not just the owner) to create hosts there

"available" field means that the nameserver is operating and reachable
2013-10-27 05:28:30 +01:00

22 lines
760 B
Python

import pytest
from django.utils.translation import activate
# Note: fixture must be "function" scope (default), see https://github.com/pelme/pytest_django/issues/33
@pytest.fixture(autouse=True)
def db_init(db):
"""
Init the database contents for testing, so we have a service domain, ...
"""
from nsupdate.main.models import Domain
Domain.objects.create(domain='nsupdate.info',
nameserver_ip='85.10.192.104',
nameserver_update_algorithm='HMAC_SHA512',
nameserver_update_key='YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYQ==',
public=True)
def pytest_runtest_setup(item):
activate('en')