<s> from __future__ import unicode_literals <EOL> from django . db import migrations <EOL> from django_nyt . utils import subscribe <EOL> from testapp . models import NOTIFICATION_TEST_KEY <EOL> FIXTURES = ( <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ) <EOL> def create_users ( apps , schema_editor ) : <EOL> from django . contrib . auth import get_user_model <EOL> user_model = get_user_model ( ) <EOL> for username , email in FIXTURES : <EOL> user = user_model . objects . create ( <EOL> username = username , <EOL> email = email , <EOL> is_active = True , <EOL> ) <EOL> from django_nyt . models import Settings <EOL> settings = Settings . get_default_setting ( user ) <EOL> subscribe ( settings , NOTIFICATION_TEST_KEY ) <EOL> def remove_users ( apps , schema_editor ) : <EOL> user_model = apps . get_model ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> user_model . objects . filter ( username__in = [ entry [ <NUM_LIT:0> ] for entry in FIXTURES ] ) . delete ( ) <EOL> class Migration ( migrations . Migration ) : <EOL> dependencies = [ <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ] <EOL> operations = [ <EOL> migrations . RunPython ( create_users , reverse_code = remove_users ) <EOL> ] </s>
