Added mocks for the generated service objects. Also fixed a bunch of formatting.
diff --git a/samples/django_sample/buzz/models.py b/samples/django_sample/buzz/models.py
index 10a83ef..11a408d 100644
--- a/samples/django_sample/buzz/models.py
+++ b/samples/django_sample/buzz/models.py
@@ -8,22 +8,26 @@
from apiclient.ext.django_orm import FlowThreeLeggedField
from apiclient.ext.django_orm import OAuthCredentialsField
-# Create your models here.
-
# The Flow could also be stored in memcache since it is short lived.
+
+
class Flow(models.Model):
id = models.ForeignKey(User, primary_key=True)
flow = FlowThreeLeggedField()
+
class Credential(models.Model):
id = models.ForeignKey(User, primary_key=True)
credential = OAuthCredentialsField()
+
class CredentialAdmin(admin.ModelAdmin):
pass
+
class FlowAdmin(admin.ModelAdmin):
pass
+
admin.site.register(Credential, CredentialAdmin)
admin.site.register(Flow, FlowAdmin)
diff --git a/samples/django_sample/buzz/tests.py b/samples/django_sample/buzz/tests.py
index 2247054..927cadf 100644
--- a/samples/django_sample/buzz/tests.py
+++ b/samples/django_sample/buzz/tests.py
@@ -7,7 +7,9 @@
from django.test import TestCase
+
class SimpleTest(TestCase):
+
def test_basic_addition(self):
"""
Tests that 1 + 1 always equals 2.
@@ -20,4 +22,3 @@
>>> 1 + 1 == 2
True
"""}
-
diff --git a/samples/django_sample/buzz/views.py b/samples/django_sample/buzz/views.py
index aeb0ca2..5c5a5d1 100644
--- a/samples/django_sample/buzz/views.py
+++ b/samples/django_sample/buzz/views.py
@@ -11,9 +11,9 @@
from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response
-print os.environ
STEP2_URI = 'http://localhost:8000/auth_return'
+
@login_required
def index(request):
try:
@@ -45,6 +45,7 @@
f.save()
return HttpResponseRedirect(authorize_url)
+
@login_required
def auth_return(request):
try:
diff --git a/samples/django_sample/settings.py b/samples/django_sample/settings.py
index 834ce1f..565d2e5 100644
--- a/samples/django_sample/settings.py
+++ b/samples/django_sample/settings.py
@@ -10,12 +10,12 @@
MANAGERS = ADMINS
-DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
-DATABASE_NAME = 'database.sqlite3' # Or path to database file if using sqlite3.
-DATABASE_USER = '' # Not used with sqlite3.
-DATABASE_PASSWORD = '' # Not used with sqlite3.
-DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3.
-DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3.
+DATABASE_ENGINE = 'sqlite3'
+DATABASE_NAME = 'database.sqlite3'
+DATABASE_USER = ''
+DATABASE_PASSWORD = ''
+DATABASE_HOST = ''
+DATABASE_PORT = ''
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
@@ -67,7 +67,7 @@
ROOT_URLCONF = 'django_sample.urls'
TEMPLATE_DIRS = (
- # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
+ # Put strings here, like "/home/html/django_templates"
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
os.path.join(os.path.dirname(__file__), 'templates')