From ba1ab57eafeeb1961a0dac944989c7f17137135a Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Tue, 30 Jan 2018 17:43:02 +0000 Subject: [PATCH] Added a test factories file for mailinglists. - Legacy-Id: 14588 --- ietf/mailinglists/factories.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 ietf/mailinglists/factories.py diff --git a/ietf/mailinglists/factories.py b/ietf/mailinglists/factories.py new file mode 100644 index 000000000..f49a3925f --- /dev/null +++ b/ietf/mailinglists/factories.py @@ -0,0 +1,18 @@ +# Copyright The IETF Trust 2018, All Rights Reserved +# -*- coding: utf-8 -*- +from __future__ import unicode_literals, print_function + +import factory +import random + +from ietf.mailinglists.models import List + +class ListFactory(factory.DjangoModelFactory): + class Meta: + model = List + + name = factory.Faker('word') + description = factory.Faker('sentence', nb_words=10) + advertised = factory.LazyAttribute(lambda obj: random.randint(0, 1)) + +