skillfed

behave-django

Behave BDD integration for Django

behave-django v2.0.0 264.1K downloads/30d#8,343 on PyPI216
Permissive license MIT Active released

What it is and what it does

behave-django bridges Behave, a Gherkin-based behavior-driven development framework, into Django projects. It lets you write acceptance tests in plain-language feature files and execute them against a Django application with full access to the test client, Django's assertion library, and database transaction isolation per scenario.

The package handles the plumbing: it configures Behave to run within Django's test environment, manages database state between scenarios, and provides hooks for fixture loading and page object patterns. It's designed for teams that want to write acceptance criteria in Gherkin (readable by non-developers) while leveraging Django's testing infrastructure and optionally automating browser interactions via beautifulsoup4.

Use it for:

  • Write acceptance tests in Gherkin that non-technical stakeholders can read and understand alongside developers.
  • Test Django views and workflows end-to-end with clean database state between each scenario.
  • Automate web UI testing using Django's test client or browser automation without leaving the Behave framework.
  • Validate complex user journeys across multiple Django views in a single feature file.
  • Integrate BDD testing into CI/CD pipelines using Behave's command-line interface and configuration files.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Integrates Behave BDD testing into Django projects, enabling scenario-driven testing with database isolation, Django's test client, and browser automation support.

Yes, if you're running Django 5.2 or 6.0 on Python 3.10+ and want to adopt BDD testing with Gherkin scenarios. The package is actively maintained, has no known vulnerabilities, low install friction, and a permissive license. It's well-suited for teams that value readable acceptance criteria and Django's test infrastructure together.

Install

behave-django on PyPI

pip

pip install behave-django

uv

uv add behave-django

poetry

poetry add behave-django

Installing behave-django

Before you install

Low friction installation with a wheel distribution. Actively maintained as of 71 days ago with recent commits and a stable codebase. Requires Python 3.10 or later and is tested against Django 5.2 and 6.0.

License in practice

MIT license permits commercial and private use with minimal restrictions—you may use, modify, and distribute behave-django freely provided you include the license notice.

Quickstart

pip install behave-django

from behave_django import *

# In features/steps/steps.py:
from behave import given, when, then

@given('a Django test environment')
def step_impl(context):
    pass

Requires Python 3.10 or later and a Django project (5.2 or 6.0) already set up.

Verify before relying

  • Whether page object patterns are built-in or require manual implementation.
  • Specific browser automation libraries supported beyond beautifulsoup4.
  • Whether fixture loading covers Django fixtures or custom formats.
  • Performance characteristics when running large scenario suites.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 3 — behave, django, beautifulsoup4
Maintenance actively maintained — 71 days since the last release
Last repo commit
First released
Downloads 264,114/month — #8,343 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: behave_django-2.0.0-py3-none-any.whl

Keywords: bdd, behave, django, testing

Development Status :: 5 - Production/StableEnvironment :: ConsoleEnvironment :: PluginsEnvironment :: Web EnvironmentFramework :: DjangoFramework :: Django :: 5.2Framework :: Django :: 6.0Intended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Internet :: WWW/HTTPTopic :: Internet :: WWW/HTTP :: Dynamic ContentTopic :: Software Development :: Testing

Tags

behave django bdd testingdjango scenario testingbdd framework djangodjango acceptance testinggherkin django testsdjango feature testingbehavior driven development django
bdddjango-integrationacceptance-testing

More WWW/HTTP packages