Skip to content

Commit

Permalink
Merge branch 'release-0.1.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
mixxorz committed Apr 6, 2015
2 parents d98d93d + 408c7fc commit 354bd1d
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 49 deletions.
4 changes: 4 additions & 0 deletions .behaverc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[behave]
paths=features/
test_app/features/

27 changes: 0 additions & 27 deletions README.md

This file was deleted.

57 changes: 57 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
behave-django
=============

|Build Status| |Latest Version|

Behave BDD integration for Django

Features
--------

- Web Browser Automation ready
- Database transactions per scenario
- Use Django's testing client
- Use unittest + Django assert library
- Use behave's command line arguments
- Use behave's configuration file

Getting started
---------------

`Read the wiki! <https://github.com/mixxorz/behave-django/wiki/Getting-started>`__

Support
-------

behave-django is tested on Django 1.7.7 and 1.8 on Python 2.7, 3.3 and 3.4. However, it may work with other setups.

Contributing
------------

`Read the quick contributing guide <CONTRIBUTING.md>`__

Changelog
---------

0.1.2
^^^^^

- FEATURE: You can now have a :code:`.behaverc` in your project's root directory. You can specify where your feature directories are in this file, among other things. See the `behave docs on configuration files <https://pythonhosted.org/behave/behave.html#configuration-files>`__.
- FEATURE: Removed BEHAVE\_FEATURES setting in favor of using behave's configuration file

0.1.1
^^^^^

- FEATURE: Behave management command now accepts behave command line arguments
- FEATURE: BEHAVE\_FEATURES settings added for multiple feature directories
- BUGFIX: Removed test apps and projects from the release package

0.1.0
^^^^^

- Initial release

.. |Build Status| image:: https://travis-ci.org/mixxorz/behave-django.svg?branch=master
:target: https://travis-ci.org/mixxorz/behave-django
.. |Latest Version| image:: https://pypip.in/version/behave-django/badge.svg
:target: https://pypi.python.org/pypi/behave-django/
2 changes: 1 addition & 1 deletion behave_django/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# Release 0.1.1
# Release 0.1.2
18 changes: 4 additions & 14 deletions behave_django/management/commands/behave.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
from __future__ import absolute_import
from optparse import make_option
import os
import sys

from behave.configuration import Configuration, options
from behave.runner import Runner
from django.conf import settings
from behave.configuration import options
from behave.__main__ import main as behave_main
from django.core.management.base import BaseCommand
from django.test.runner import DiscoverRunner

Expand Down Expand Up @@ -47,22 +46,13 @@ class Command(BaseCommand):
option_list = BaseCommand.option_list + get_behave_options()

def handle(self, *args, **options):
# Configure Behave
configuration = Configuration()
if settings.BEHAVE_FEATURES:
configuration.paths = [x for x in settings.BEHAVE_FEATURES]
else:
configuration.paths = [os.path.join(settings.BASE_DIR, 'features')]
configuration.format = ['pretty']

# Configure django environment
django_test_runner = DiscoverRunner()
django_test_runner.setup_test_environment()
old_config = django_test_runner.setup_databases()

# Run Behave tests
runner = Runner(configuration)
runner.run()
behave_main(args=sys.argv[2:])

# Teardown django environment
django_test_runner.teardown_databases(old_config)
Expand Down
6 changes: 5 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
import os
from setuptools import find_packages, setup

with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
README = readme.read()

# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))

setup(
name='behave-django',
version='0.1.1',
version='0.1.2',
packages=find_packages(exclude=['test*']),
include_package_data=True,
license='MIT License',
description='Behave BDD integration for Django',
long_description=README,
url='https://github.com/mixxorz/behave-django',
author='Mitchel Cabuloy',
author_email='[email protected]',
Expand Down
6 changes: 0 additions & 6 deletions test_project/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,3 @@
# https://docs.djangoproject.com/en/1.7/howto/static-files/

STATIC_URL = '/static/'

# behave_django
BEHAVE_FEATURES = (
os.path.join(BASE_DIR, 'features'),
os.path.join(BASE_DIR, 'test_app', 'features')
)

0 comments on commit 354bd1d

Please sign in to comment.