Skip to content

Commit

Permalink
Getting tests running again locally
Browse files Browse the repository at this point in the history
  • Loading branch information
pydanny committed Nov 12, 2013
1 parent a70b58d commit a3fc6b3
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 10 deletions.
16 changes: 10 additions & 6 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,23 @@ Ready to contribute? Here's how to set up `dj-stripe` for local development.

$ git clone [email protected]:your_name_here/dj-stripe.git

3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development::
3. Assuming the tests are run against PostgreSQL::

createdb djstripe

4. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development::

$ mkvirtualenv dj-stripe
$ cd dj-stripe/
$ python setup.py develop

4. Create a branch for local development::
5. Create a branch for local development::

$ git checkout -b name-of-your-bugfix-or-feature

Now you can make your changes locally.

5. When you're done making changes, check that your changes pass flake8 and the
6. When you're done making changes, check that your changes pass flake8 and the
tests, including testing other Python versions with tox::

$ pip install -r requirements_test.txt
Expand All @@ -84,18 +88,18 @@ tests, including testing other Python versions with tox::

To get flake8 and tox, just pip install them into your virtualenv.

6. Check the test coverage report. Make sure coverage hasn't dropped::
7. Check the test coverage report. Make sure coverage hasn't dropped::

$ coverage run --source djstripe runtests.py
$ coverage report -m

6. Commit your changes and push your branch to GitHub::
8. Commit your changes and push your branch to GitHub::

$ git add .
$ git commit -m "Your detailed description of your changes."
$ git push origin name-of-your-bugfix-or-feature

7. Submit a pull request through the GitHub website.
9. Submit a pull request through the GitHub website.

Pull Request Guidelines
-----------------------
Expand Down
3 changes: 2 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,9 @@ Start up the webserver:
Running the Tests
------------------

::
Assuming the tests are run against PostgreSQL::

createdb djstripe
pip install -r requirements_text.txt
coverage run --source djstripe runtests.py
coverage report -m
Expand Down
5 changes: 4 additions & 1 deletion requirements_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,7 @@ django-nose>=1.2
# registration + subscription requirements
django-floppyforms
django-crispy-forms
django-allauth
django-allauth

# Tightly constrained database for more accurate testing
psycopg2
9 changes: 7 additions & 2 deletions runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@
USE_TZ=True,
DATABASES={
"default": {
"ENGINE": "django.db.backends.sqlite3",
}
"ENGINE": "django.db.backends.postgresql_psycopg2",
"NAME": "djstripe",
"USER": "",
"PASSWORD": "",
"HOST": "",
"PORT": "",
},
},
ROOT_URLCONF="djstripe.urls",
INSTALLED_APPS=[
Expand Down

0 comments on commit a3fc6b3

Please sign in to comment.