<s> import pytest <EOL> from django . test import TestCase <EOL> from pytest_django_test . app . models import Item <EOL> class TestFixtures ( TestCase ) : <EOL> fixtures = [ '<STR_LIT>' ] <EOL> def test_fixtures ( self ) : <EOL> assert Item . objects . count ( ) == <NUM_LIT:1> <EOL> assert Item . objects . get ( ) . name == '<STR_LIT>' <EOL> def test_fixtures_again ( self ) : <EOL> """<STR_LIT>""" <EOL> self . test_fixtures ( ) <EOL> class TestSetup ( TestCase ) : <EOL> def setUp ( self ) : <EOL> """<STR_LIT>""" <EOL> assert Item . objects . count ( ) == <NUM_LIT:0> <EOL> Item . objects . create ( name = '<STR_LIT>' ) <EOL> Item . objects . create ( name = '<STR_LIT>' ) <EOL> def test_count ( self ) : <EOL> self . assertEqual ( Item . objects . count ( ) , <NUM_LIT:2> ) <EOL> assert Item . objects . count ( ) == <NUM_LIT:2> <EOL> Item . objects . create ( name = '<STR_LIT>' ) <EOL> self . assertEqual ( Item . objects . count ( ) , <NUM_LIT:3> ) <EOL> def test_count_again ( self ) : <EOL> self . test_count ( ) <EOL> def tearDown ( self ) : <EOL> """<STR_LIT>""" <EOL> assert Item . objects . count ( ) == <NUM_LIT:3> <EOL> class TestFixturesWithSetup ( TestCase ) : <EOL> fixtures = [ '<STR_LIT>' ] <EOL> def setUp ( self ) : <EOL> assert Item . objects . count ( ) == <NUM_LIT:1> <EOL> Item . objects . create ( name = '<STR_LIT>' ) <EOL> def test_count ( self ) : <EOL> assert Item . objects . count ( ) == <NUM_LIT:2> <EOL> Item . objects . create ( name = '<STR_LIT>' ) <EOL> def test_count_again ( self ) : <EOL> self . test_count ( ) <EOL> def tearDown ( self ) : <EOL> assert Item . objects . count ( ) == <NUM_LIT:3> <EOL> def test_sole_test ( django_testdir ) : <EOL> """<STR_LIT>""" <EOL> django_testdir . create_test_module ( '''<STR_LIT>''' ) <EOL> result = django_testdir . runpytest_subprocess ( '<STR_LIT>' ) <EOL> result . stdout . fnmatch_lines ( [ <EOL> "<STR_LIT>" , <EOL> ] ) <EOL> assert result . ret == <NUM_LIT:0> <EOL> class TestUnittestMethods : <EOL> "<STR_LIT>" <EOL> def test_django ( self , django_testdir ) : <EOL> django_testdir . create_test_module ( '''<STR_LIT>''' ) <EOL> result = django_testdir . runpytest_subprocess ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> result . stdout . fnmatch_lines ( [ <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> ] ) <EOL> assert result . ret == <NUM_LIT:0> <EOL> def test_multi_inheritance_setUpClass ( self , django_testdir ) : <EOL> django_testdir . create_test_module ( '''<STR_LIT>''' ) <EOL> result = django_testdir . runpytest_subprocess ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> assert result . parseoutcomes ( ) [ '<STR_LIT>' ] == <NUM_LIT:6> <EOL> assert result . ret == <NUM_LIT:0> <EOL> def test_unittest ( self , django_testdir ) : <EOL> django_testdir . create_test_module ( '''<STR_LIT>''' ) <EOL> result = django_testdir . runpytest_subprocess ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> result . stdout . fnmatch_lines ( [ <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> ] ) <EOL> assert result . ret == <NUM_LIT:0> <EOL> class TestCaseWithDbFixture ( TestCase ) : <EOL> pytestmark = pytest . mark . usefixtures ( '<STR_LIT>' ) <EOL> def test_simple ( self ) : <EOL> assert <NUM_LIT:1> <EOL> class TestCaseWithTrDbFixture ( TestCase ) : <EOL> pytestmark = pytest . mark . usefixtures ( '<STR_LIT>' ) <EOL> def test_simple ( self ) : <EOL> assert <NUM_LIT:1> </s>
