evorepo/mirrors/tests/__init__.py
Jelle van der Waa a1b14a4173 Implement cleaning up older log entries in mirrorcheck
MirrorLog entries are not cleaned up by default and will clog the
database. The django settings now defines a retention period in days for
how long to keep mirror logs, on every mirrorcheck run older logs will
be removed from the database.
2018-07-22 22:03:06 +02:00

14 lines
661 B
Python

from mirrors.models import MirrorUrl, MirrorProtocol, Mirror
def create_mirror_url(name='mirror1', country='US',
protocol='http', url='https://archlinux.org/'):
mirror = Mirror.objects.create(name=name,
admin_email='admin@archlinux.org')
mirror_protocol = MirrorProtocol.objects.create(protocol=protocol)
mirror_url = MirrorUrl.objects.create(url=url,
protocol=mirror_protocol,
mirror=mirror,
country=country)
return mirror_url