Commit 68d4f784 authored by Patrick Kimber's avatar Patrick Kimber

init testing

parent da40ab99
This diff is collapsed.
booking
Booking
*******
Django application for booking
Install
=======
Virtual Environment
-------------------
Note: replace ``patrick`` with your name (checking in the ``example`` folder
to make sure a file has been created for you)::
mkvirtualenv dev_booking
pip install -r requirements/local.txt
echo "export DJANGO_SETTINGS_MODULE=example.dev_patrick" >> $VIRTUAL_ENV/bin/postactivate
echo "unset DJANGO_SETTINGS_MODULE" >> $VIRTUAL_ENV/bin/postdeactivate
add2virtualenv ../base
add2virtualenv ../login
add2virtualenv .
deactivate
To check the order of the imports::
workon dev_booking
cdsitepackages
cat _virtualenv_path_extensions.pth
Check the imports are in the correct order e.g::
/home/patrick/repo/dev/app/booking
/home/patrick/repo/dev/app/login
/home/patrick/repo/dev/app/base
Testing
=======
Using ``pytest-django``::
workon dev_booking
find . -name '*.pyc' -delete
py.test
To stop on first failure::
py.test -x
Usage
=====
::
workon dev_booking
py.test -x && \
touch temp.db && rm temp.db && \
django-admin.py syncdb --noinput && \
django-admin.py migrate --all --noinput && \
django-admin.py demo_data_login && \
django-admin.py demo_data_booking && \
django-admin.py runserver
Release
=======
simple booking system
https://github.com/pkimber/docs
......@@ -11,6 +11,16 @@ from booking.tests.model_maker import make_booking
class TestBooking(TestCase):
def test_booking(self):
"""A simple booking."""
today = datetime.today()
next_week = today + timedelta(days=7)
make_booking(
next_week,
next_week + timedelta(days=3),
'Three days in the sun'
)
def test_end_before_start(self):
"""Booking - start before the end!"""
today = datetime.today()
......@@ -22,3 +32,10 @@ class TestBooking(TestCase):
next_week + timedelta(days=-2),
'Two days in the sun',
)
def test_double_booking(self):
"""Don't allow a double booking.
Not going to check this for now.
"""
pass
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment