def setUp(self):
     lazy_record.connect_db()
     lazy_record.load_schema(test_schema)
     self.person = Person()
     self.person.save()
     self.book = Book()
     self.book.save()
 def setUp(self):
     lazy_record.connect_db()
     lazy_record.load_schema(test_schema)
     self.person = Person.create()
     self.book = Book.create()
     self.lending = Lending.create(person_id=self.person.id,
                                   book_id=self.book.id)
 def setUp(self):
     lazy_record.connect_db()
     lazy_record.load_schema(test_schema)
     self.person = Person()
     self.person.save()
     self.book = Book()
     self.book.save()
 def setUp(self):
     lazy_record.connect_db()
     lazy_record.load_schema(test_schema)
     self.person = Person.create()
     self.book = Book.create()
     self.lending = Lending.create(person_id=self.person.id,
                                   book_id=self.book.id)
 def setUp(self):
     lazy_record.connect_db()
     lazy_record.load_schema(test_schema)
     self.person = Person()
     self.person.save()
     self.book = Book()
     self.book.save()
     Lending(person_id=self.person.id, book_id=self.book.id).save()
 def setUp(self):
     lazy_record.connect_db()
     lazy_record.load_schema(test_schema)
     self.person = Person()
     self.person.save()
     self.book = Book()
     self.book.save()
     Lending(person_id=self.person.id, book_id=self.book.id).save()
def main():
    if sys.argv[1] == "db":
        lazy_record.connect_db(config.DATABASE)
        with open(config.SCHEMA) as schema:
            lazy_record.load_schema(schema.read())
        app.seeds.seed()
    elif sys.argv[1] in ("server", "s"):
        # Remove these for production
        import mock
        app.webservice.models.services.ControlCluster.bus = mock.Mock(
            name="bus")
        coffee.livecompile(app.webservice.app)
        app.webservice.models.lazy_record.connect_db(config.DATABASE)
        app.webservice.run()
    elif sys.argv[1] == "console":
        app.webservice.models.lazy_record.connect_db(config.DATABASE)
    elif sys.argv[1] == "production":
        app.webservice.models.lazy_record.connect_db(config.DATABASE)
        coffee.precompile(app.webservice.app)
        app.webservice.config.DEBUG = False
        app.webservice.config.PORT = 80
        app.webservice.run()
 def setUp(self):
     lazy_record.connect_db()
     lazy_record.load_schema(test_schema)
     self.book = Book.create()
     self.thing = Thing.create(book_id=self.book.id)
     self.other_thing = OtherThing.create(thing_id=self.thing.id)
 def setUp(self):
     lazy_record.connect_db()
     lazy_record.load_schema(test_schema)
     self.book = Book.create()
     self.thing = Thing.create(book_id=self.book.id)
     self.other_thing = OtherThing.create(thing_id=self.thing.id)