<commit_before>from localization import Province, Country, Store
from user import User
from receipt import Receipt, Item
import datetime

def populate_all_tables(session):
    populate_provinces_tbl(session)

def populate_provinces_tbl(session):
    canada = Country("CAN", "Canada")
    
    ontario = Province('Ontario','ON', 13)
    quebec = Province('Quebec','QC', 14.975)
    
    canada.provinces = [Province('Alberta','AB', 5),
                     Province('British Columbia','BC', 12),
                     Province('Manitoba','MB', 13),
                     Province('New Brunswick','NB', 13),
                     Province('Newfoundland and Labrador','NL', 13),
                     Province('Northwest Territories','NT', 5),
                     Province('Nova Scotia','NS', 15),
                     Province('Nunavut','NU', 5),
                     ontario,
                     Province('Prince Edward Island','PE', 14),
                     quebec,
                     Province('Saskatchewan','SK', 10),
                     Province('Yukon','YT', 5)
                     ]
    session.add(canada)
    
    jhooey = User("Jacob", "Hooey", "jhooey", "password")
    
    loblaws = Store("Loblaws", "Rideau and Nelson", ontario)
    Maxi = Store("Maxi", "Hull St. Joseph", quebec)
    
    loblaws_receipt1 = Receipt(loblaws)
    loblaws_receipt2 = Receipt(loblaws, datetime.date.fromordinal(datetime.date.today().toordinal()-1))
    loblaws_receipt3 = Receipt(loblaws, datetime.date.fromordinal(datetime.date.today().toordinal()-4))
    
    bananas = Item('Bananas', 'yellow fruit', False)
    napkins = Item('Napkins', 'paper napkins', True)
    
    jhooey.add_receipt(loblaws_receipt1)
    jhooey.add_receipt(loblaws_receipt2)
    jhooey.add_receipt(loblaws_receipt3)
    
    
    session.add_all([
                     loblaws,
                     Maxi,
                     Store("Herb and Spice Shop", "375 Bank Street", ontario),
                     jhooey,
                     bananas,
                     napkins
                    ],
                   )




    session.commit()
<commit_msg>Added Categories to test data. Closes #34<commit_after>from localization import Province, Country, Store
from user import User
from receipt import Receipt, Item, Category
import datetime

def populate_all_tables(session):
    populate_provinces_tbl(session)

def populate_provinces_tbl(session):
    canada = Country("CAN", "Canada")
    
    ontario = Province('Ontario','ON', 13)
    quebec = Province('Quebec','QC', 14.975)
    
    canada.provinces = [Province('Alberta','AB', 5),
                     Province('British Columbia','BC', 12),
                     Province('Manitoba','MB', 13),
                     Province('New Brunswick','NB', 13),
                     Province('Newfoundland and Labrador','NL', 13),
                     Province('Northwest Territories','NT', 5),
                     Province('Nova Scotia','NS', 15),
                     Province('Nunavut','NU', 5),
                     ontario,
                     Province('Prince Edward Island','PE', 14),
                     quebec,
                     Province('Saskatchewan','SK', 10),
                     Province('Yukon','YT', 5)
                     ]
    session.add(canada)
    
    
    #Create test user
    jhooey = User("Jacob", "Hooey", "jhooey", "password")
    
    #Create test Stores
    loblaws = Store("Loblaws", "Rideau and Nelson", ontario)
    Maxi = Store("Maxi", "Hull St. Joseph", quebec)
    herbspice = Store("Herb and Spice Shop", "375 Bank Street", ontario)
    
    
    #Create test Receipts
    loblaws_receipt1 = Receipt(loblaws)
    loblaws_receipt2 = Receipt(loblaws, datetime.date.fromordinal(datetime.date.today().toordinal()-1))
    loblaws_receipt3 = Receipt(loblaws, datetime.date.fromordinal(datetime.date.today().toordinal()-4))
    
    #Create Test Items
    bananas = Item('Bananas', 'yellow fruit', False)
    napkins = Item('Napkins', 'paper napkins', True)
    
    #Add Receipts to test user
    jhooey.add_receipt(loblaws_receipt1)
    jhooey.add_receipt(loblaws_receipt2)
    jhooey.add_receipt(loblaws_receipt3)
    
    
    session.add_all([
                     loblaws,
                     Maxi,
                     herbspice,
                     jhooey,
                     bananas,
                     napkins,
                     Category('Food', 'Stuff you eat'),
                     Category('Household Supplies', "Stuff you don't eat")
                    ],
                   )




    session.commit()

{'fraction_non_alphanumeric': 0.12134439109559145, 'fraction_numerical': 0.016150152771715408, 'mean_word_length': 1.9510624597553123, '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': '733826', 'n_tokens_mistral': 1529, 'n_tokens_neox': 1356, 'n_words': 272}