Пример #1
0
    def __init__(self, year_levels=None, student_count=60, attending_count=50, recipient_count=80):
        self.student_count = student_count
        self.attending_count = attending_count
        self.recipient_count = recipient_count

        self.student_ids = []
        self._alphabet = [c for c in 'abcdefghijklmnopqrstuvwxyz']

        self._app = create_app()
        self._app.app_context().push()

        self.year_levels = year_levels
        if year_levels is None:
            self.year_levels = self._app.config['YEAR_LEVELS']

        self.award_count = 0
Пример #2
0
from awards import db, models, create_app

if __name__ == '__main__':
    if input(
            'Are you sure you want to nuke all the tables in the database from space? (y/N) '
    ) == 'y':
        app = create_app()
        app.app_context().push()
        models.Student.query.delete()
        models.Awards.query.delete()
        models.AwardRecipients.query.delete()
        db.session.commit()
        print('Done!')
    else:
        print('Canceled!')
Пример #3
0
 def setUp(self):
     self.app = create_app()
     self.client = self.app.test_client()
     self.md = MockDB()
     self.md.setUp()
Пример #4
0
 def setUp(self):
     self.app = create_app()
     self.md = MockDB()
     self.md.setUp()
     self.sm = utils.StudentManager()
Пример #5
0
 def setUp(self):
     self.app = create_app()
     self.md = MockDB()
     self.md.setUp()