djangoldp-notification/djangoldp_notification/factories.py
Matthieu Fesselier aa90880073 feature: factories
2019-01-11 17:46:23 +07:00

17 lines
637 B
Python

import factory
from .models import Notification
from django.contrib.auth.models import User
from django.db.models.signals import post_save
@factory.django.mute_signals(post_save)
class NotificationFactory(factory.django.DjangoModelFactory):
class Meta:
model = Notification
type = factory.Faker('text', max_nb_chars=50)
summary = factory.Faker('paragraph', nb_sentences=3, variable_nb_sentences=True)
author_user = factory.Iterator(User.objects.all())
user = factory.Iterator(User.objects.all())
date = factory.Faker('past_datetime')
read = factory.Faker('boolean')
object = factory.Faker('url')