YAML fields in Fixtures

Hi,

One of my fields in my tables is a TEXT fields that holds a YAML
document.
I want to create tests for this model, and can’t figure out how to
create the fixtures, such that one of the fixture fields is itself a
YAML document …

Anybody any ideas?

Joerg

Is this even possible?

One of my fields in my tables is a TEXT fields that holds a YAML
document.
I want to create tests for this model, and can’t figure out how to
create the fixtures, such that one of the fixture fields is itself a
YAML document …

Ok - I’ve solved it:

You can use the | symbol in YAML to denote a literal block. So I can do
something like this:

id: 1
name: My name
calc_sheet: | <— note the | symbol
min_value: 1
max_value: 10
matrix:
0: 1.1
5: 1.0
10: 0.9

Joerg D. wrote:

Is this even possible?

One of my fields in my tables is a TEXT fields that holds a YAML
document.
I want to create tests for this model, and can’t figure out how to
create the fixtures, such that one of the fixture fields is itself a
YAML document …