diff --git a/notifications/tests/factories/__init__.py b/notifications/tests/factories/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/notifications/tests/factories/users.py b/notifications/tests/factories/users.py new file mode 100644 index 0000000..c53fa4d --- /dev/null +++ b/notifications/tests/factories/users.py @@ -0,0 +1,26 @@ +from django.conf import settings +import factory + + +class Recipient(factory.django.DjangoModelFactory): + username = factory.Sequence(lambda n: f"recipient-{n}") + first_name = factory.SelfAttribute("username") + + class Meta: + model = settings.AUTH_USER_MODEL + + +class Actor(factory.django.DjangoModelFactory): + username = factory.Sequence(lambda n: f"actor-{n}") + first_name = factory.SelfAttribute("username") + + class Meta: + model = settings.AUTH_USER_MODEL + + +class Target(factory.django.DjangoModelFactory): + username = factory.Sequence(lambda n: f"target-{n}") + first_name = factory.SelfAttribute("username") + + class Meta: + model = settings.AUTH_USER_MODEL