Skip to content

Commit

Permalink
Add Travis CI and a minimal test project to run tests
Browse files Browse the repository at this point in the history
I also moved adyen/tests.py to tests/test_adyen.py.
  • Loading branch information
Nicolas Dubois committed Apr 29, 2015
1 parent 3b0b452 commit eea6c95
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 4 deletions.
14 changes: 14 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
language: python

python:
- "3.3"
- "3.4"

install:
- pip install 'django-oscar>=0.7'
- pip install -r requirements.txt

env:
- PYTHONPATH=.:$PYTHONPATH

script: py.test tests
3 changes: 3 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ Adyen package for django-oscar
:target: https://pypi.python.org/pypi/django-oscar-adyen/
:alt: Supported Python versions

.. image:: https://api.travis-ci.org/oscaro/django-oscar-adyen.svg
:target: https://travis-ci.org/oscaro/django-oscar-adyen

This package provides integration with the `Adyen`_ payment gateway. It is
designed to work seamlessly with the e-commerce framework `django-oscar`_ but
can be used without Oscar. This extension supports Django 1.6+, Python 3.3+ and
Expand Down
12 changes: 12 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[pytest]
DJANGO_SETTINGS_MODULE=tests.settings
addopts = --pyargs --reuse-db

; Imitate Django's test discovery pattern. py.test's default is test_*.py
python_files=test*.py

flakes-ignore =
migrations/* ALL

; new pep8 relaxed rules
pep8maxlinelength = 100
Empty file added tests/__init__.py
Empty file.
23 changes: 23 additions & 0 deletions tests/settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# """
# Django settings for tests project.
# """

import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))

SECRET_KEY = '+&l^d!%soa4gxsnx7_txbo0x3uv$@4i&n!r8yte72otwqo7vmh'

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}

OSCAR_DEFAULT_CURRENCY = 'EUR'

MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
)

INSTALLED_APPS = ('adyen',)
8 changes: 4 additions & 4 deletions adyen/tests.py → tests/test_adyen.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@

from freezegun import freeze_time

from .gateway import MissingFieldException, InvalidTransactionException
from .models import AdyenTransaction
from .scaffold import Scaffold
from .facade import Facade
from adyen.gateway import MissingFieldException, InvalidTransactionException
from adyen.models import AdyenTransaction
from adyen.scaffold import Scaffold
from adyen.facade import Facade


TEST_IDENTIFIER = 'OscaroFR'
Expand Down

0 comments on commit eea6c95

Please sign in to comment.