Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TDD/BDD framework for use with Django?

Tags:

python

testing

I'm trying to decide which approach to take to testing a Django app I'm writing. I've seen Cucumber and that put me onto lettuce (URL is lettuce.it) and pycurracy. I like the look of these frameworks since hopefully non-technical people will be able to write definitions.

I want to be able to:

  • run functional tests integrated with Django, so sometimes inspecting models,
  • test behaviours via a web browser - pycurracy seems to make this easier since there are already Selenium bindings. But Selenium is slow, so I'd be happier using a headless, ideally Javascript-capable browser for testing.

It seems like Lettuce can do the first easily, but the second will require me to build a library of steps for actions like "I click button x", etc. Conversely, I can't see any specific mention of Django and Pycurracy, although it can handle the second point.

Lettuce has a lower version number, but that doesn't mean it's inferior.

Has anyone used either or both of these? Any advice?

How do these work out when you have a reasonably large/complex project?

like image 770
BartD Avatar asked Oct 08 '10 14:10

BartD


People also ask

Can you use TDD and BDD together?

There are different methodologies you can use for your testing. The two big methodologies being used right now are test driven development (TDD) and behavior driven development (BDD). They both have their own ways of handling testing and they both work best when used together.

What is TDD in Django?

Test Driven Development (TDD) is an iterative development cycle that emphasizes writing automated tests before writing the actual code. The process is simple: Write your tests first. Watch them fail. Write just enough code to make those tests pass.

What is TDD and BDD framework?

Definition. TDD is a development technique that focuses more on the implementation of a feature. BDD is a development technique that focuses on the system's behavior. ATDD is a technique similar to BDD focusing more on capturing the requirements.


1 Answers

It seems that at the moment, Lettuce can do a lot of what you want, and it has built-in support for Django.

But why not use a combination of the tools you like?

like image 124
Fabian Fagerholm Avatar answered Oct 19 '22 16:10

Fabian Fagerholm