<s> from __future__ import unicode_literals <EOL> from django . db import DEFAULT_DB_ALIAS <EOL> class TestRouter ( object ) : <EOL> """<STR_LIT>""" <EOL> def db_for_read ( self , model , instance = None , ** hints ) : <EOL> if instance : <EOL> return instance . _state . db or '<STR_LIT>' <EOL> return '<STR_LIT>' <EOL> def db_for_write ( self , model , ** hints ) : <EOL> return DEFAULT_DB_ALIAS <EOL> def allow_relation ( self , obj1 , obj2 , ** hints ) : <EOL> return obj1 . _state . db in ( '<STR_LIT:default>' , '<STR_LIT>' ) and obj2 . _state . db in ( '<STR_LIT:default>' , '<STR_LIT>' ) <EOL> def allow_migrate ( self , db , app_label , ** hints ) : <EOL> return True <EOL> class AuthRouter ( object ) : <EOL> """<STR_LIT>""" <EOL> def db_for_read ( self , model , ** hints ) : <EOL> "<STR_LIT>" <EOL> if model . _meta . app_label == '<STR_LIT>' : <EOL> return '<STR_LIT:default>' <EOL> return None <EOL> def db_for_write ( self , model , ** hints ) : <EOL> "<STR_LIT>" <EOL> if model . _meta . app_label == '<STR_LIT>' : <EOL> return '<STR_LIT>' <EOL> return None <EOL> def allow_relation ( self , obj1 , obj2 , ** hints ) : <EOL> "<STR_LIT>" <EOL> if obj1 . _meta . app_label == '<STR_LIT>' or obj2 . _meta . app_label == '<STR_LIT>' : <EOL> return True <EOL> return None <EOL> def allow_migrate ( self , db , app_label , ** hints ) : <EOL> "<STR_LIT>" <EOL> if app_label == '<STR_LIT>' : <EOL> return db == '<STR_LIT>' <EOL> return None <EOL> class WriteRouter ( object ) : <EOL> def db_for_write ( self , model , ** hints ) : <EOL> return '<STR_LIT>' </s>
