<commit_before>import os
import unittest

from flask.ext.script import Manager

from server import create_app
from server.models import db

from server.models import Lecturer, Course, Lecture, Comment

manager = Manager(create_app)


@manager.command
def init_db():
    """ Initialize database: drop and create all columns """
    db.drop_all()
    db.create_all()


@manager.command
def mock_db():
    """ Insert mock data into database """
    init_db()

    simon = Lecturer('Simon', 'McCallum')
    db.session.add(simon)

    imt3601 = Course('IMT3601 - Game Programming', simon)
    db.session.add(imt3601)

    imt3601_l1 = Lecture('Lecture 1', imt3601)
    db.session.add(imt3601_l1)

    imt3601_l1_c1 = Comment('This is boring', imt3601_l1)
    db.session.add(imt3601_l1_c1)
    imt3601_l1_c2 = Comment('This is fun!', imt3601_l1)<commit_msg>Fix mock_db being broken because of Comment Model change<commit_after>import os
import unittest
from datetime import datetime

from flask.ext.script import Manager

from server import create_app
from server.models import db

from server.models import Lecturer, Course, Lecture, Comment

manager = Manager(create_app)


@manager.command
def init_db():
    """ Initialize database: drop and create all columns """
    db.drop_all()
    db.create_all()


@manager.command
def mock_db():
    """ Insert mock data into database """
    init_db()

    simon = Lecturer('Simon', 'McCallum')
    db.session.add(simon)

    imt3601 = Course('IMT3601 - Game Programming', simon)
    db.session.add(imt3601)

    imt3601_l1 = Lecture('Lecture 1', imt3601)
    db.session.add(imt3601_l1)

    imt3601_l1_c1 = Comment('This is boring', datetime.utcnow(), imt3601_l1)
    db.session.add(imt3601_l1_c1)
    imt3601_l1_c2 = Comment('This is fun!', datetime.utcnow(), imt3601_l1)
{'fraction_non_alphanumeric': 0.10810810810810811, 'fraction_numerical': 0.06067291781577496, 'mean_word_length': 4.168091168091168, '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': '2031517', 'n_tokens_mistral': 708, 'n_tokens_neox': 630, 'n_words': 157}