From 1853d320208fb11ef9a683cfe981993e2dddecf5 Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Thu, 28 Feb 2013 19:52:14 -0500 Subject: [PATCH] Various Django cleanup --- Makefile | 23 +++++++++++++++++++++++ acom/main/tests.py | 9 --------- acom/settings.pyc | Bin 1990 -> 2109 bytes app_setup/setup.yml | 6 +++--- app_setup/templates/settings.py.j2 | 7 +++++++ 5 files changed, 33 insertions(+), 12 deletions(-) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000000..8fef8a710d --- /dev/null +++ b/Makefile @@ -0,0 +1,23 @@ +setup: + ansible-playbook app_setup/setup.yml -i "127.0.0.1," -c local -e working_dir=`pwd` + +syncdb: + python acom/manage.py syncdb + +runserver: + python acom/manage.py runserver + +# already done and should not have to happen again: +# +#south_init: +# PYTHON_PATH=./acom python acom/manage.py schemamigration main --initial + +dbchange: + PYTHON_PATH=./acom python acom/manage.py schemamigration main --auto + +migrate: + PYTHON_PATH=./acom python acom/manage.py migrate main --auto + +test: + PYTHON_PATH=./acom python acom/manage.py test main + diff --git a/acom/main/tests.py b/acom/main/tests.py index 2247054b35..074bdc3781 100644 --- a/acom/main/tests.py +++ b/acom/main/tests.py @@ -9,15 +9,6 @@ from django.test import TestCase class SimpleTest(TestCase): def test_basic_addition(self): - """ - Tests that 1 + 1 always equals 2. - """ self.failUnlessEqual(1 + 1, 2) -__test__ = {"doctest": """ -Another way to test that 1 + 1 is equal to 2. - ->>> 1 + 1 == 2 -True -"""} diff --git a/acom/settings.pyc b/acom/settings.pyc index c24372f364ff0c5507ea52ceb266f384415e7793..a0133886f02676a379821f4b604f46280dc06771 100644 GIT binary patch delta 377 zcmXYsJ4*vW6ot?1Zg!JRHrc!kh^3EB69pxeg_WJ6*j=zla)-PmqO%BsnBO1^{*lzS z7It>x&#=^Dy}LThoR2$q?qSYr?Im2ke+7Q`XZL)B|5X$o$uS=yEL&j?5TF&vg0?_5 zcoXD6JD>t43KJJ>fo=5J0T%>v;R%Z1lE4R-|4mjF{U8bD!2)f@fIiqZ-MIIZBPTe0cwJGKrL_tYG;Wq zqOPQyrm3B#r%!K56gyJK+Qeo(i#;1G#@9U__J)JeTrb%4%+1v_*88hV^Y!6otQ=rb(Lg*Thz+i{O8{wIBq?LYFQr6t_DG-av8f+Lw?#L?0mFq^rA6 zA~-qvYw*DR4)-3ooR8u&Uwr+zbpAWtJoB&E``pj&;8B4Jm7oE3iFT+uXvkLBMi`h- zzAn#S5-g>(j8eN;AN8q2V{CvX?Vn!D6id*oWgp8?hZX1myFzp98ZEFh^aQ&>huAGT v!Y+86-1$niNZq{4K9F_u5RQYM^T)~QF?ots&0BOY;qthB$79KAm(2bEy_F{V diff --git a/app_setup/setup.yml b/app_setup/setup.yml index d490a03c89..4b050a781b 100644 --- a/app_setup/setup.yml +++ b/app_setup/setup.yml @@ -60,7 +60,7 @@ django_manage: > command=syncdb app_path=${working_dir}/acom - - #- name: run south migrations - # command: python ${working_dir}/acom/manage.py migrate db_migrate + + - name: run south migrations + command: python ${working_dir}/acom/manage.py migrate main diff --git a/app_setup/templates/settings.py.j2 b/app_setup/templates/settings.py.j2 index 486821bc30..5c90dba074 100644 --- a/app_setup/templates/settings.py.j2 +++ b/app_setup/templates/settings.py.j2 @@ -1,5 +1,7 @@ # Django settings for acom project. +import sys + DEBUG = True TEMPLATE_DEBUG = DEBUG @@ -20,6 +22,11 @@ DATABASES = { } } +if 'test' in sys.argv: + DATABASES['default'] = { + 'ENGINE': 'django.db.backends.sqlite3' + } + # Local time zone for this installation. Choices can be found here: # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name # although not all choices may be available on all operating systems.