Commits

powersurge360  committed fa56212

Wrote most of the boilerplate code, gearing up to write authentication
code.

  • Participants

Comments (0)

Files changed (8)

+settings.py

File requirements.txt

+Flask==0.9
+Flask-Login==0.1.3
+Flask-MongoRest==0.1.1
+Flask-Testing==0.4
+Flask-WTF==0.8
+Jinja2==2.6
+WTForms==1.0.2
+Werkzeug==0.8.3
+argparse==1.2.1
+flask-mongoengine==0.6
+mongoengine==0.6.20
+pymongo==2.3
+twill==0.9
+wsgiref==0.1.2

File toast/__init__.py

+from flask import Flask
+
+from flask.ext.login import LoginManager
+from flask.ext.mongoengine import MongoEngine
+
+db = MongoEngine()
+login_manager = LoginManager()
+
+
+def create_app(testing=False):
+    app = Flask("toast")
+
+    if not testing:
+        app.config.from_envvar("TOAST_SETTINGS")
+    else:
+        app.config.from_object("toast.test.settings")
+
+    db.init_app(app)
+    login_manager.setup_app(app)
+
+    return app

File toast/__main__.py

+from toast import create_app
+
+app = create_app()
+
+app.run()

File toast/food/__init__.py

Empty file added.

File toast/test/__init__.py

+from flask.ext.testing import TestCase
+
+from toast import create_app
+
+
+class ToastTestCase(TestCase):
+    def create_app(self):
+        return create_app(testing=True)

File toast/test/settings.py

+MONGODB_DB = "test_toast"
+TESTING = True

File toast/test/test_authentication.py

+from toast.test import ToastTestCase
+
+
+class AuthenticationTests(ToastTestCase):
+    def test_login_success(self):
+        pass
+
+    def test_login_failure(self):
+        pass
+
+    def test_logout(self):
+        pass
+
+
+class UserTests(ToastTestCase):
+    def test_register(self):
+        pass
+
+    def test_login(self):
+        pass