<s> import sys , os <EOL> sys . path . append ( os . path . realpath ( os . sep . join ( [ os . path . dirname ( __file__ ) , os . pardir ] ) ) ) <EOL> from django . core . management import setup_environ <EOL> import settings <EOL> setup_environ ( settings ) <EOL> from django . db . models . loading import cache <EOL> cache . _populate ( ) <EOL> import codecs <EOL> from django . core import serializers <EOL> from django . contrib . auth . models import User as AuthUser <EOL> from issue . models import Issue <EOL> from users . models import User <EOL> from org . models import Org <EOL> from users . models import Location <EOL> from donation . models import * <EOL> from message . models import Publication , Subscription , Message <EOL> donations = list ( Donation . objects . all ( ) [ : <NUM_LIT:5> ] ) <EOL> payments = Payment . objects . filter ( donation__in = donations ) <EOL> donors = Donor . objects . filter ( donations__in = donations ) <EOL> users = User . objects . filter ( id__in = [ d . user . id for d in donors if d ] ) <EOL> beneficiaries = DonationBeneficiary . objects . filter ( donation__in = donations ) <EOL> donor_addresses = DonorAddress . objects . filter ( donor__in = donors ) <EOL> donor_phones = DonorPhone . objects . filter ( donor__in = donors ) <EOL> credit_cards = CreditCard . objects . filter ( donor__in = donors ) <EOL> attempting_donation = donations [ <NUM_LIT:0> ] <EOL> attempting_donation . charge_status = Donation . ChargeStatus . ATTEMPTING_PAYMENT <EOL> attempting_donation . id = <NUM_LIT:1> <EOL> dontattempt_donation = donations [ <NUM_LIT:1> ] <EOL> dontattempt_donation . charge_status = Donation . ChargeStatus . DO_NOT_ATTEMPT <EOL> dontattempt_donation . id = <NUM_LIT:2> <EOL> complete_donation = donations [ <NUM_LIT:2> ] <EOL> complete_donation . charge_status = Donation . ChargeStatus . PAYMENT_COMPLETE <EOL> complete_donation . id = <NUM_LIT:3> <EOL> paid_donation = donations [ <NUM_LIT:3> ] <EOL> paid_donation . payment_status = Donation . PaymentStatus . PAID <EOL> paid_donation . id = <NUM_LIT:4> <EOL> permafail_donation = donations [ <NUM_LIT:4> ] <EOL> permafail_donation . payment_status = Donation . PaymentStatus . PERMAFAILED <EOL> permafail_donation . id = <NUM_LIT:5> <EOL> dons = [ attempting_donation , dontattempt_donation , complete_donation , paid_donation , permafail_donation ] <EOL> fixtures = list ( dons ) + list ( users ) + list ( donors ) + list ( beneficiaries ) + list ( donor_addresses ) + list ( donor_phones ) + list ( credit_cards ) <EOL> data = serializers . serialize ( '<STR_LIT>' , fixtures , indent = <NUM_LIT:4> ) <EOL> data_file = os . path . join ( os . path . dirname ( os . path . abspath ( __file__ ) ) , "<STR_LIT>" ) <EOL> fh = codecs . open ( data_file , '<STR_LIT:w>' , encoding = '<STR_LIT>' ) <EOL> fh . write ( data ) <EOL> fh . close ( ) <EOL> print "<STR_LIT>" % data_file </s>
