def get_instance(cls):
        if cls.__instance == None:
            try:
                from tinysubscriptions import tiny_subscriptions
            except:
                import tiny_subscriptions

            app = tiny_subscriptions.get_app()

            if app.config['FAKE_MONGO']:
                cls.create_instance(FakeMongoDB())
            else:
                cls.create_instance(PyMongo(app))

        return cls.__instance
Example #2
0
    def get_instance(cls):
        if cls.__instance == None:
            try:
                from tinysubscriptions import tiny_subscriptions
            except:
                import tiny_subscriptions

            app = tiny_subscriptions.get_app()

            if app.config['FAKE_MONGO']:
                cls.create_instance(FakeMongoDB())
            else:
                cls.create_instance(PyMongo(app))

        return cls.__instance
 def setUp(self):
     mox.MoxTestBase.setUp(self)
     app = tiny_subscriptions.get_app()
     app.debug = True
     self.app = app.test_client()
 def setUp(self):
     mox.MoxTestBase.setUp(self)
     app = tiny_subscriptions.get_app()
     app.debug = True
     self.app = app.test_client()