add faker helper method

This commit is contained in:
b1ek 2023-05-17 14:17:40 +10:00
parent d19364c38d
commit 3c7cf9918a
Signed by: blek
GPG Key ID: 14546221E3595D0C
1 changed files with 11 additions and 1 deletions

View File

@ -134,4 +134,14 @@ class UserFactory(factory.django.DjangoModelFactory):
openid_addr = OpenID_Address();
openid_id = UUID();
photo_provider = Random(0,0,0, ['VVSU', 'GRAVATAR']);
photo_provider = Random(0,0,0, ['VVSU', 'GRAVATAR']);
def fake(size: int):
"""
This method is designed to be conveniently used within a
django shell, like this:
>>> from pairent_app.factories import fake;
>>> fake(42);
"""
ApartmentFactory.create_batch(size);
UserFactory.create_batch(size);