<s> import pytest <EOL> from example . models import Blog <EOL> from example . factories import BlogFactory <EOL> pytestmark = pytest . mark . django_db <EOL> def test_factory_instance ( blog_factory ) : <EOL> assert blog_factory == BlogFactory <EOL> def test_model_instance ( blog ) : <EOL> assert isinstance ( blog , Blog ) <EOL> def test_multiple_blog ( blog_factory ) : <EOL> another_blog = blog_factory ( name = '<STR_LIT>' ) <EOL> new_blog = blog_factory ( name = '<STR_LIT>' ) <EOL> assert another_blog . name == '<STR_LIT>' <EOL> assert new_blog . name == '<STR_LIT>' <EOL> def test_factories_with_relations ( author_factory , entry_factory ) : <EOL> author = author_factory ( name = "<STR_LIT>" ) <EOL> entry = entry_factory ( <EOL> headline = ( "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" ) , <EOL> blog__name = '<STR_LIT>' , authors = ( author , ) ) <EOL> assert entry . blog . name == '<STR_LIT>' <EOL> assert entry . headline == ( "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" ) <EOL> assert entry . authors . all ( ) . count ( ) == <NUM_LIT:1> <EOL> assert entry . authors . all ( ) [ <NUM_LIT:0> ] . name == '<STR_LIT>' </s>
