I\'ve defined some timestamps for events in the database as auto_now_add
, as the information should be stored with it\'s timestamp the same time the event is st
I've managed to create data overriding the default values using a fixture.
I've created a test_data.json
file with the data in the following format:
[
{
"model": "stats_agg.newevent",
"pk": 1,
"fields": {
"name": "event1",
"quantity":0.0,
"timestamp": "2010-02-15 00:27:40"
}
},
{
"model": "stats_agg.newevent",
"pk": 2,
"fields": {
"name": "event1",
"quantity":1.0,
"timestamp": "2010-02-15 00:27:40"
}
},
...
and then add to the test unit
class SimpleTest(TestCase):
fixtures = ['test_data.json']