Skip to content

Commit

Permalink
More
Browse files Browse the repository at this point in the history
  • Loading branch information
barseghyanartur committed Dec 1, 2023
1 parent 7d26896 commit f4774c7
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions examples/django/article/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@


class UserFactory(DjangoModelFactory):
"""User factory.
Usage example:
.. code-block:: python
user = UserFactory()
users = UserFactory.create_batch(5)
"""

username = FACTORY.username()
first_name = FACTORY.first_name()
last_name = FACTORY.last_name()
Expand All @@ -39,6 +49,14 @@ def __set_password(instance):


class ArticleFactory(DjangoModelFactory):
"""Article factory.
Usage example:
article = ArticleFactory()
articles = ArticleFactory.create_batch(5)
"""

title = FACTORY.sentence()
slug = FACTORY.slug()
content = FACTORY.text()
Expand All @@ -50,12 +68,3 @@ class ArticleFactory(DjangoModelFactory):

class Meta:
model = Article


#
# # Create an User instance
# user = UserFactory()
# users = UserFactory.create_batch(5)
#
# article = ArticleFactory()
# articles = ArticleFactory.create_batch(5)

0 comments on commit f4774c7

Please sign in to comment.