Git Product home page Git Product logo

tdd-with-django-reusable-app's Introduction

Test Driven Development with Django Reusable Apps

This is the code for my talk at PyCon APAC 2012 about test driven development with Django reusable apps.

Video: https://www.youtube.com/watch?v=bAo9HcLt8NQ

Slides: https://speakerdeck.com/u/mbrochh/p/tdd-with-django

There is another repository that covers the code for Django projects: https://github.com/mbrochh/tdd-with-django-project

This is an example repository structure that should show how you can layout a Django reusable app so that if fulfills the following criteria:

  • is ready for test driven development
  • can be tested on travis.ci.org
  • can be uploaded to the Python package index

This code can be used by anyone for anything! I am using this code as a template for reusable apps myself, therefore I included a LICENSE file. Just replace Your Name with your name when you kickstart a new reusable app from this code.

Also, you might want to delete all the above text and kickstart your real README with the content below:

Replace all occurrences of your-name, your-app-name, package_name, your-url

Installation

If you want to install the latest stable release from PyPi:

$ pip install your-app-name

If you feel adventurous and want to install the latest commit from GitHub:

$ pip install -e git://github.com/yourname/your-app-name.git#egg=package_name

Add package_name to your INSTALLED_APPS:

INSTALLED_APPS = (
    ...,
    'package_name',
)

Hook this app into your urls.py:

urlpatterns = patterns('',
    ...
    url(r'^your-url/$', include('package_name.urls')),
)

Usage

TODO: Describe usage, for example:

  • ./manage.py syncdb --migrate
  • ./manage.py collectstatic

Contribute

If you want to contribute to this project, please perform the following steps:

# Fork this repository
# Clone your fork
$ mkvirtualenv -p python2.7 django-online-docs
$ pip install -r requirements.txt
$ ./online_docs/tests/runtests.sh
# You should get no failing tests

$ git co -b feature_branch master
# Implement your feature and tests
$ git add . && git commit
$ git push origin feature_branch
# Send us a pull request for your feature branch

Whenever you run the tests a coverage output will be generated in tests/coverage/index.html. When adding new features, please make sure that you keep the coverage at 100%.

Oh and... if you submit patches that make our tests fail, you will be publicly humiliated on http://travis-ci.org/#!/yourname/your-app-name ;)

If you are making changes that need to be tested in a browser (i.e. to the CSS or JS files), you might want to setup a Django project, follow the installation instructions above, then run python setup.py develop. This will just place an egg-link to your cloned fork in your project's virtualenv.

Roadmap

See the issue list on GitHub for features that are planned for the next milestone.

tdd-with-django-reusable-app's People

Contributors

mbrochh avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.