Opened 9 years ago

Closed 9 years ago

#3735 closed (wontfix)

Add the ability for fixtures to be dynamic

Reported by: russellm Owned by: russellm
Component: Testing framework Version: master
Severity: Keywords:
Cc: Triage Stage: Design decision needed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


Gijs <gijs.nijholt@…> raised the idea of dynamic fixtures. These are available in Rails; Rails fixture files (in YAML) can have embedded Ruby commands in them, so:

<% for i in 1..1000 %> 
fix_<%= i %>:
  id: <%= i %>
  name: guy_<%= 1 %>
<% end %> 

would define a fixture with 1000 instances of an object.

Django fixtures would benefit from having a similar capability. Using ERb is out of the question, but the Django template system could be a candidate for providing logic to _any_ fixture format.

Change History (2)

comment:1 Changed 9 years ago by russellm

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Status changed from new to assigned
  • Triage Stage changed from Unreviewed to Design decision needed

comment:2 Changed 9 years ago by russellm

  • Resolution set to wontfix
  • Status changed from assigned to closed

Opinion on the dev list resolved that this would unnecessarily complicate the fixtures engine, for functionality that could be implemented as raw code in the test setUp() block.

Note: See TracTickets for help on using tickets.
Back to Top