djangoldp-notification/djangoldp_notification/factories.py
Matthieu Fesselier c9b3155f08 Merge branch 'new-counter' into 'master'
update: subscription system

See merge request startinblox/djangoldp-packages/djangoldp-notifications!9
2019-04-24 09:29:40 +00:00

18 lines
633 B
Python

import factory
from django.conf import settings
from .models import Notification
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.Faker('url')
user = factory.Iterator(settings.AUTH_USER_MODEL.objects.all())
date = factory.Faker('past_datetime')
unread = factory.Faker('boolean')
object = factory.Faker('url')