<commit_before>from rapidsms.tests.scripted import TestScript
from apps.form.models import *
from apps.reporters.models import *
import apps.reporters.app as reporter_app
import apps.nigeria.app as nigeria_app
import apps.form.app as form_app
from app import App
from models import *
from django.core.management.commands.dumpdata import Command
import random
import time
from datetime import datetime, timedelta

class TestApp (TestScript):
    apps = (reporter_app.App, App,form_app.App, nigeria_app.App )
    fixtures = ['nigeria_llin', 'kano_locations']
    
    def setUp(self):
        TestScript.setUp(self)
        # have to initialize the backend for the reporters app to function properly
        title = self.backend.name
        try:
            PersistantBackend.objects.get(title=title)
        except PersistantBackend.DoesNotExist:
            PersistantBackend(title=title).save()

    def testFixture(self): 
        """"This isn't actually a test.  It just takes advantage
            of the test harness to spam a bunch of messages to the 
            supply app and spit out the data in a format that can
            be sucked into a fixture"""
        # this is the number of transactions that will be generated
        transaction_count = 100
        
        # these are the locations that will be the origins, chosen randomly
        # from this list
        # the destinations will be chosen randomly from the origins' children
        originating_locations = [20, 2001, 2002, 2003,2004]
        stock_levels = dict([[loc, random.randint(1, 10000) * 10 + 50000] for loc in originating_locations])
            
        
        # the sender will always be the same, for now
        phone = "55555"
        all_txns = []
        # these are the percentages these items will match
        waybill_match_percent = .9
        amount_match_percent = .9
        loc_match_percent = .95
        num_locs = len(Location.objects.all())
        
        # allow specifying the minimum and maximum dates for message generation
        min_date = datetime(2009,4,1)
        max_date = datetime(2009,4,30)
        min_time = time.mktime(min_date.timetuple())
        max_time = time.mktime(max_date.timetuple())
        
        # generate the array of dates we're going to use at the start.  This is so we can order 
        # our transactions
        iss_dates = []
        for i in range(transaction_count):<commit_msg>making the supply data generator not generate anything by default<commit_after>from rapidsms.tests.scripted import TestScript
from apps.form.models import *
from apps.reporters.models import *
import apps.reporters.app as reporter_app
import apps.nigeria.app as nigeria_app
import apps.form.app as form_app
from app import App
from models import *
from django.core.management.commands.dumpdata import Command
import random
import time
from datetime import datetime, timedelta

class TestApp (TestScript):
    apps = (reporter_app.App, App,form_app.App, nigeria_app.App )
    fixtures = ['nigeria_llin', 'kano_locations']
    
    def setUp(self):
        TestScript.setUp(self)
        # have to initialize the backend for the reporters app to function properly
        title = self.backend.name
        try:
            PersistantBackend.objects.get(title=title)
        except PersistantBackend.DoesNotExist:
            PersistantBackend(title=title).save()

    def testFixture(self): 
        """"This isn't actually a test.  It just takes advantage
            of the test harness to spam a bunch of messages to the 
            supply app and spit out the data in a format that can
            be sucked into a fixture"""
        # this is the number of transactions that will be generated
        transaction_count = 0
        
        # these are the locations that will be the origins, chosen randomly
        # from this list
        # the destinations will be chosen randomly from the origins' children
        originating_locations = [20, 2001, 2002, 2003,2004]
        stock_levels = dict([[loc, random.randint(1, 10000) * 10 + 50000] for loc in originating_locations])
            
        
        # the sender will always be the same, for now
        phone = "55555"
        all_txns = []
        # these are the percentages these items will match
        waybill_match_percent = .9
        amount_match_percent = .9
        loc_match_percent = .95
        num_locs = len(Location.objects.all())
        
        # allow specifying the minimum and maximum dates for message generation
        min_date = datetime(2009,4,1)
        max_date = datetime(2009,4,30)
        min_time = time.mktime(min_date.timetuple())
        max_time = time.mktime(max_date.timetuple())
        
        # generate the array of dates we're going to use at the start.  This is so we can order 
        # our transactions
        iss_dates = []
        for i in range(transaction_count):
{'fraction_non_alphanumeric': 0.06672091131000814, 'fraction_numerical': 0.022375915378356388, 'mean_word_length': 2.5630434782608695, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2590285', 'n_tokens_mistral': 1424, 'n_tokens_neox': 1305, 'n_words': 480}