<s> from __future__ import absolute_import , unicode_literals <EOL> import json <EOL> import os <EOL> import re <EOL> import warnings <EOL> from django . core . serializers . base import DeserializationError <EOL> from django . core import management <EOL> from django . core . management . base import CommandError <EOL> from django . core . management . commands . dumpdata import sort_dependencies <EOL> from django . db import transaction , IntegrityError <EOL> from django . db . models import signals <EOL> from django . test import ( TestCase , TransactionTestCase , skipIfDBFeature , <EOL> skipUnlessDBFeature ) <EOL> from django . test . utils import override_settings <EOL> from django . utils . encoding import force_text <EOL> from django . utils . _os import upath <EOL> from django . utils import six <EOL> from django . utils . six import PY3 , StringIO <EOL> from . models import ( Animal , Stuff , Absolute , Parent , Child , Article , Widget , <EOL> Store , Person , Book , NKChild , RefToNKChild , Circle1 , Circle2 , Circle3 , <EOL> ExternalDependency , Thingy ) <EOL> _cur_dir = os . path . dirname ( os . path . abspath ( upath ( __file__ ) ) ) <EOL> class TestFixtures ( TestCase ) : <EOL> def animal_pre_save_check ( self , signal , sender , instance , ** kwargs ) : <EOL> self . pre_save_checks . append ( <EOL> ( <EOL> '<STR_LIT>' % ( instance . count , type ( instance . count ) ) , <EOL> '<STR_LIT>' % ( instance . weight , type ( instance . weight ) ) , <EOL> ) <EOL> ) <EOL> def test_duplicate_pk ( self ) : <EOL> """<STR_LIT>""" <EOL> management . call_command ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> verbosity = <NUM_LIT:0> , <EOL> ) <EOL> animal = Animal ( <EOL> name = '<STR_LIT>' , <EOL> latin_name = '<STR_LIT>' , <EOL> count = <NUM_LIT:2> , <EOL> weight = <NUM_LIT> <EOL> ) <EOL> animal . save ( ) <EOL> self . assertGreater ( animal . id , <NUM_LIT:1> ) <EOL> def test_loaddata_not_found_fields_not_ignore ( self ) : <EOL> """<STR_LIT>""" <EOL> with self . assertRaises ( DeserializationError ) : <EOL> management . call_command ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> verbosity = <NUM_LIT:0> <EOL> ) <EOL> def test_loaddata_not_found_fields_ignore ( self ) : <EOL> """<STR_LIT>""" <EOL> management . call_command ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ignore = True , <EOL> verbosity = <NUM_LIT:0> , <EOL> ) <EOL> self . assertEqual ( Animal . specimens . all ( ) [ <NUM_LIT:0> ] . name , '<STR_LIT>' ) <EOL> def test_loaddata_not_found_fields_ignore_xml ( self ) : <EOL> """<STR_LIT>""" <EOL> management . call_command ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ignore = True , <EOL> verbosity = <NUM_LIT:0> , <EOL> ) <EOL> self . assertEqual ( Animal . specimens . all ( ) [ <NUM_LIT:0> ] . name , '<STR_LIT>' ) <EOL> @ skipIfDBFeature ( '<STR_LIT>' ) <EOL> def test_pretty_print_xml ( self ) : <EOL> """<STR_LIT>""" <EOL> management . call_command ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> verbosity = <NUM_LIT:0> , <EOL> ) <EOL> self . assertEqual ( Stuff . objects . all ( ) [ <NUM_LIT:0> ] . name , None ) <EOL> self . assertEqual ( Stuff . objects . all ( ) [ <NUM_LIT:0> ] . owner , None ) <EOL> @ skipUnlessDBFeature ( '<STR_LIT>' ) <EOL> def test_pretty_print_xml_empty_strings ( self ) : <EOL> """<STR_LIT>""" <EOL> management . call_command ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> verbosity = <NUM_LIT:0> , <EOL> ) <EOL> self . assertEqual ( Stuff . objects . all ( ) [ <NUM_LIT:0> ] . name , '<STR_LIT>' ) <EOL> self . assertEqual ( Stuff . objects . all ( ) [ <NUM_LIT:0> ] . owner , None ) <EOL> def test_absolute_path ( self ) : <EOL> """<STR_LIT>""" <EOL> load_absolute_path = os . path . join ( <EOL> os . path . dirname ( upath ( __file__ ) ) , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' <EOL> ) <EOL> management . call_command ( <EOL> '<STR_LIT>' , <EOL> load_absolute_path , <EOL> verbosity = <NUM_LIT:0> , <EOL> ) <EOL> self . assertEqual ( Absolute . objects . count ( ) , <NUM_LIT:1> ) <EOL> def test_relative_path ( self , path = [ '<STR_LIT>' , '<STR_LIT>' ] ) : <EOL> relative_path = os . path . join ( * path ) <EOL> cwd = os . getcwd ( ) <EOL> try : <EOL> os . chdir ( _cur_dir ) <EOL> management . call_command ( <EOL> '<STR_LIT>' , <EOL> relative_path , <EOL> verbosity = <NUM_LIT:0> , <EOL> ) <EOL> finally : <EOL> os . chdir ( cwd ) <EOL> self . assertEqual ( Absolute . objects . count ( ) , <NUM_LIT:1> ) <EOL> @ override_settings ( FIXTURE_DIRS = [ os . path . join ( _cur_dir , '<STR_LIT>' ) ] ) <EOL> def test_relative_path_in_fixture_dirs ( self ) : <EOL> self . test_relative_path ( path = [ '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> def test_path_containing_dots ( self ) : <EOL> management . call_command ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> verbosity = <NUM_LIT:0> , <EOL> ) <EOL> self . assertEqual ( Absolute . objects . count ( ) , <NUM_LIT:1> ) <EOL> def test_unknown_format ( self ) : <EOL> """<STR_LIT>""" <EOL> with six . assertRaisesRegex ( self , management . CommandError , <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" ) : <EOL> management . call_command ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> verbosity = <NUM_LIT:0> , <EOL> ) <EOL> @ override_settings ( SERIALIZATION_MODULES = { '<STR_LIT>' : '<STR_LIT>' } ) <EOL> def test_unimportable_serializer ( self ) : <EOL> """<STR_LIT>""" <EOL> with six . assertRaisesRegex ( self , ImportError , <EOL> r"<STR_LIT>" ) : <EOL> management . call_command ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> verbosity = <NUM_LIT:0> , <EOL> ) <EOL> def test_invalid_data ( self ) : <EOL> """<STR_LIT>""" <EOL> with six . assertRaisesRegex ( self , management . CommandError , <EOL> "<STR_LIT>" ) : <EOL> management . call_command ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> verbosity = <NUM_LIT:0> , <EOL> ) <EOL> def test_invalid_data_no_ext ( self ) : <EOL> """<STR_LIT>""" <EOL> with six . assertRaisesRegex ( self , management . CommandError , <EOL> "<STR_LIT>" ) : <EOL> management . call_command ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> verbosity = <NUM_LIT:0> , <EOL> ) <EOL> def test_empty ( self ) : <EOL> """<STR_LIT>""" <EOL> with six . assertRaisesRegex ( self , management . CommandError , <EOL> "<STR_LIT>" ) : <EOL> management . call_command ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> verbosity = <NUM_LIT:0> , <EOL> ) <EOL> def test_error_message ( self ) : <EOL> """<STR_LIT>""" <EOL> with six . assertRaisesRegex ( self , management . CommandError , <EOL> "<STR_LIT>" ) : <EOL> management . call_command ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> verbosity = <NUM_LIT:0> , <EOL> ) <EOL> def test_pg_sequence_resetting_checks ( self ) : <EOL> """<STR_LIT>""" <EOL> management . call_command ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> verbosity = <NUM_LIT:0> , <EOL> ) <EOL> self . assertEqual ( Parent . objects . all ( ) [ <NUM_LIT:0> ] . id , <NUM_LIT:1> ) <EOL> self . assertEqual ( Child . objects . all ( ) [ <NUM_LIT:0> ] . id , <NUM_LIT:1> ) <EOL> def test_close_connection_after_loaddata ( self ) : <EOL> """<STR_LIT>""" <EOL> management . call_command ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> verbosity = <NUM_LIT:0> , <EOL> ) <EOL> articles = Article . objects . exclude ( id = <NUM_LIT:9> ) <EOL> self . assertEqual ( <EOL> list ( articles . values_list ( '<STR_LIT:id>' , flat = True ) ) , <EOL> [ <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:4> , <NUM_LIT:5> , <NUM_LIT:6> , <NUM_LIT:7> , <NUM_LIT:8> ] <EOL> ) <EOL> self . assertEqual ( <EOL> list ( articles . values_list ( '<STR_LIT:id>' , flat = True ) ) , <EOL> [ <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:4> , <NUM_LIT:5> , <NUM_LIT:6> , <NUM_LIT:7> , <NUM_LIT:8> ] <EOL> ) <EOL> def test_field_value_coerce ( self ) : <EOL> """<STR_LIT>""" <EOL> self . pre_save_checks = [ ] <EOL> signals . pre_save . connect ( self . animal_pre_save_check ) <EOL> try : <EOL> management . call_command ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> verbosity = <NUM_LIT:0> , <EOL> ) <EOL> self . assertEqual ( <EOL> self . pre_save_checks , <EOL> [ <EOL> ( "<STR_LIT>" % ( '<STR_LIT:class>' if PY3 else '<STR_LIT:type>' ) , <EOL> "<STR_LIT>" % ( '<STR_LIT:class>' if PY3 else '<STR_LIT:type>' ) ) <EOL> ] <EOL> ) <EOL> finally : <EOL> signals . pre_save . disconnect ( self . animal_pre_save_check ) <EOL> def test_dumpdata_uses_default_manager ( self ) : <EOL> """<STR_LIT>""" <EOL> management . call_command ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> verbosity = <NUM_LIT:0> , <EOL> ) <EOL> management . call_command ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> verbosity = <NUM_LIT:0> , <EOL> ) <EOL> animal = Animal ( <EOL> name = '<STR_LIT>' , <EOL> latin_name = '<STR_LIT>' , <EOL> count = <NUM_LIT:2> , <EOL> weight = <NUM_LIT> <EOL> ) <EOL> animal . save ( ) <EOL> stdout = StringIO ( ) <EOL> management . call_command ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> format = '<STR_LIT>' , <EOL> stdout = stdout <EOL> ) <EOL> data = stdout . getvalue ( ) <EOL> data = re . sub ( '<STR_LIT>' , '<STR_LIT>' , data ) <EOL> animals_data = sorted ( [ <EOL> { "<STR_LIT>" : <NUM_LIT:1> , "<STR_LIT>" : "<STR_LIT>" , "<STR_LIT>" : { "<STR_LIT:count>" : <NUM_LIT:3> , "<STR_LIT>" : <NUM_LIT> , "<STR_LIT:name>" : "<STR_LIT>" , "<STR_LIT>" : "<STR_LIT>" } } , <EOL> { "<STR_LIT>" : <NUM_LIT:10> , "<STR_LIT>" : "<STR_LIT>" , "<STR_LIT>" : { "<STR_LIT:count>" : <NUM_LIT> , "<STR_LIT>" : <NUM_LIT> , "<STR_LIT:name>" : "<STR_LIT>" , "<STR_LIT>" : "<STR_LIT>" } } , <EOL> { "<STR_LIT>" : animal . pk , "<STR_LIT>" : "<STR_LIT>" , "<STR_LIT>" : { "<STR_LIT:count>" : <NUM_LIT:2> , "<STR_LIT>" : <NUM_LIT> , "<STR_LIT:name>" : "<STR_LIT>" , "<STR_LIT>" : "<STR_LIT>" } } , <EOL> ] , key = lambda x : x [ "<STR_LIT>" ] ) <EOL> data = sorted ( json . loads ( data ) , key = lambda x : x [ "<STR_LIT>" ] ) <EOL> self . maxDiff = <NUM_LIT> <EOL> self . assertEqual ( data , animals_data ) <EOL> def test_proxy_model_included ( self ) : <EOL> """<STR_LIT>""" <EOL> stdout = StringIO ( ) <EOL> widget = Widget . objects . create ( name = '<STR_LIT>' ) <EOL> management . call_command ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> format = '<STR_LIT>' , <EOL> stdout = stdout <EOL> ) <EOL> self . assertJSONEqual ( <EOL> stdout . getvalue ( ) , <EOL> """<STR_LIT>""" <EOL> % widget . pk <EOL> ) <EOL> def test_loaddata_works_when_fixture_has_forward_refs ( self ) : <EOL> """<STR_LIT>""" <EOL> management . call_command ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> verbosity = <NUM_LIT:0> , <EOL> ) <EOL> self . assertEqual ( Book . objects . all ( ) [ <NUM_LIT:0> ] . id , <NUM_LIT:1> ) <EOL> self . assertEqual ( Person . objects . all ( ) [ <NUM_LIT:0> ] . id , <NUM_LIT:4> ) <EOL> def test_loaddata_raises_error_when_fixture_has_invalid_foreign_key ( self ) : <EOL> """<STR_LIT>""" <EOL> with six . assertRaisesRegex ( self , IntegrityError , <EOL> "<STR_LIT>" ) : <EOL> management . call_command ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> verbosity = <NUM_LIT:0> , <EOL> ) <EOL> @ override_settings ( FIXTURE_DIRS = [ os . path . join ( _cur_dir , '<STR_LIT>' ) , <EOL> os . path . join ( _cur_dir , '<STR_LIT>' ) ] ) <EOL> def test_loaddata_forward_refs_split_fixtures ( self ) : <EOL> """<STR_LIT>""" <EOL> management . call_command ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> verbosity = <NUM_LIT:0> , <EOL> ) <EOL> self . assertEqual ( Book . objects . all ( ) [ <NUM_LIT:0> ] . id , <NUM_LIT:1> ) <EOL> self . assertEqual ( Person . objects . all ( ) [ <NUM_LIT:0> ] . id , <NUM_LIT:4> ) <EOL> def test_loaddata_no_fixture_specified ( self ) : <EOL> """<STR_LIT>""" <EOL> with six . assertRaisesRegex ( self , management . CommandError , <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" ) : <EOL> management . call_command ( <EOL> '<STR_LIT>' , <EOL> verbosity = <NUM_LIT:0> , <EOL> ) <EOL> def test_loaddata_not_existant_fixture_file ( self ) : <EOL> stdout_output = StringIO ( ) <EOL> with warnings . catch_warnings ( record = True ) : <EOL> management . call_command ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> verbosity = <NUM_LIT:2> , <EOL> stdout = stdout_output , <EOL> ) <EOL> self . assertTrue ( "<STR_LIT>" in <EOL> force_text ( stdout_output . getvalue ( ) ) ) <EOL> def test_ticket_20820 ( self ) : <EOL> """<STR_LIT>""" <EOL> management . call_command ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> verbosity = <NUM_LIT:0> , <EOL> ) <EOL> class NaturalKeyFixtureTests ( TestCase ) : <EOL> def test_nk_deserialize ( self ) : <EOL> """<STR_LIT>""" <EOL> management . call_command ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> verbosity = <NUM_LIT:0> , <EOL> ) <EOL> management . call_command ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> verbosity = <NUM_LIT:0> , <EOL> ) <EOL> self . assertEqual ( <EOL> NKChild . objects . get ( pk = <NUM_LIT:1> ) . data , <EOL> '<STR_LIT>' <EOL> ) <EOL> self . assertEqual ( <EOL> RefToNKChild . objects . get ( pk = <NUM_LIT:1> ) . nk_fk . data , <EOL> '<STR_LIT>' <EOL> ) <EOL> def test_nk_deserialize_xml ( self ) : <EOL> """<STR_LIT>""" <EOL> management . call_command ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> verbosity = <NUM_LIT:0> , <EOL> ) <EOL> management . call_command ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> verbosity = <NUM_LIT:0> , <EOL> ) <EOL> management . call_command ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> verbosity = <NUM_LIT:0> , <EOL> ) <EOL> self . assertEqual ( <EOL> NKChild . objects . get ( pk = <NUM_LIT:2> ) . data , <EOL> '<STR_LIT>' <EOL> ) <EOL> self . assertEqual ( <EOL> RefToNKChild . objects . get ( pk = <NUM_LIT:2> ) . nk_fk . data , <EOL> '<STR_LIT>' <EOL> ) <EOL> def test_nk_on_serialize ( self ) : <EOL> """<STR_LIT>""" <EOL> management . call_command ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> verbosity = <NUM_LIT:0> , <EOL> ) <EOL> stdout = StringIO ( ) <EOL> management . call_command ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> verbosity = <NUM_LIT:0> , <EOL> format = '<STR_LIT>' , <EOL> use_natural_keys = True , <EOL> stdout = stdout , <EOL> ) <EOL> self . assertJSONEqual ( <EOL> stdout . getvalue ( ) , <EOL> """<STR_LIT>""" <EOL> ) <EOL> def test_dependency_sorting ( self ) : <EOL> """<STR_LIT>""" <EOL> sorted_deps = sort_dependencies ( <EOL> [ ( '<STR_LIT>' , [ Book , Person , Store ] ) ] <EOL> ) <EOL> self . assertEqual ( <EOL> sorted_deps , <EOL> [ Store , Person , Book ] <EOL> ) <EOL> def test_dependency_sorting_2 ( self ) : <EOL> sorted_deps = sort_dependencies ( <EOL> [ ( '<STR_LIT>' , [ Book , Store , Person ] ) ] <EOL> ) <EOL> self . assertEqual ( <EOL> sorted_deps , <EOL> [ Store , Person , Book ] <EOL> ) <EOL> def test_dependency_sorting_3 ( self ) : <EOL> sorted_deps = sort_dependencies ( <EOL> [ ( '<STR_LIT>' , [ Store , Book , Person ] ) ] <EOL> ) <EOL> self . assertEqual ( <EOL> sorted_deps , <EOL> [ Store , Person , Book ] <EOL> ) <EOL> def test_dependency_sorting_4 ( self ) : <EOL> sorted_deps = sort_dependencies ( <EOL> [ ( '<STR_LIT>' , [ Store , Person , Book ] ) ] <EOL> ) <EOL> self . assertEqual ( <EOL> sorted_deps , <EOL> [ Store , Person , Book ] <EOL> ) <EOL> def test_dependency_sorting_5 ( self ) : <EOL> sorted_deps = sort_dependencies ( <EOL> [ ( '<STR_LIT>' , [ Person , Book , Store ] ) ] <EOL> ) <EOL> self . assertEqual ( <EOL> sorted_deps , <EOL> [ Store , Person , Book ] <EOL> ) <EOL> def test_dependency_sorting_6 ( self ) : <EOL> sorted_deps = sort_dependencies ( <EOL> [ ( '<STR_LIT>' , [ Person , Store , Book ] ) ] <EOL> ) <EOL> self . assertEqual ( <EOL> sorted_deps , <EOL> [ Store , Person , Book ] <EOL> ) <EOL> def test_dependency_sorting_dangling ( self ) : <EOL> sorted_deps = sort_dependencies ( <EOL> [ ( '<STR_LIT>' , [ Person , Circle1 , Store , Book ] ) ] <EOL> ) <EOL> self . assertEqual ( <EOL> sorted_deps , <EOL> [ Circle1 , Store , Person , Book ] <EOL> ) <EOL> def test_dependency_sorting_tight_circular ( self ) : <EOL> self . assertRaisesMessage ( <EOL> CommandError , <EOL> """<STR_LIT>""" , <EOL> sort_dependencies , <EOL> [ ( '<STR_LIT>' , [ Person , Circle2 , Circle1 , Store , Book ] ) ] , <EOL> ) <EOL> def test_dependency_sorting_tight_circular_2 ( self ) : <EOL> self . assertRaisesMessage ( <EOL> CommandError , <EOL> """<STR_LIT>""" , <EOL> sort_dependencies , <EOL> [ ( '<STR_LIT>' , [ Circle1 , Book , Circle2 ] ) ] , <EOL> ) <EOL> def test_dependency_self_referential ( self ) : <EOL> self . assertRaisesMessage ( <EOL> CommandError , <EOL> """<STR_LIT>""" , <EOL> sort_dependencies , <EOL> [ ( '<STR_LIT>' , [ Book , Circle3 ] ) ] , <EOL> ) <EOL> def test_dependency_sorting_long ( self ) : <EOL> self . assertRaisesMessage ( <EOL> CommandError , <EOL> """<STR_LIT>""" , <EOL> sort_dependencies , <EOL> [ ( '<STR_LIT>' , [ Person , Circle2 , Circle1 , Circle3 , Store , Book ] ) ] , <EOL> ) <EOL> def test_dependency_sorting_normal ( self ) : <EOL> sorted_deps = sort_dependencies ( <EOL> [ ( '<STR_LIT>' , [ Person , ExternalDependency , Book ] ) ] <EOL> ) <EOL> self . assertEqual ( <EOL> sorted_deps , <EOL> [ Person , Book , ExternalDependency ] <EOL> ) <EOL> def test_normal_pk ( self ) : <EOL> """<STR_LIT>""" <EOL> management . call_command ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> verbosity = <NUM_LIT:0> , <EOL> ) <EOL> management . call_command ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> verbosity = <NUM_LIT:0> , <EOL> ) <EOL> management . call_command ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> verbosity = <NUM_LIT:0> , <EOL> ) <EOL> books = Book . objects . all ( ) <EOL> self . assertEqual ( <EOL> books . __repr__ ( ) , <EOL> """<STR_LIT>""" <EOL> ) <EOL> class TestTicket11101 ( TransactionTestCase ) : <EOL> available_apps = [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ] <EOL> @ skipUnlessDBFeature ( '<STR_LIT>' ) <EOL> def test_ticket_11101 ( self ) : <EOL> """<STR_LIT>""" <EOL> with transaction . atomic ( ) : <EOL> management . call_command ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> verbosity = <NUM_LIT:0> , <EOL> ) <EOL> self . assertEqual ( Thingy . objects . count ( ) , <NUM_LIT:1> ) <EOL> transaction . set_rollback ( True ) <EOL> self . assertEqual ( Thingy . objects . count ( ) , <NUM_LIT:0> ) </s>
