mercredi 30 mai 2018

Django : fixtures object not retrievable

Strange thing is happening. Here is a part of my fixture :

{
       "model": "mezzanine_agenda.event",
       "pk": 1,
       "fields": {
          "comments_count": 0,
          "keywords_string": "",
          "rating_count": 0,
          "rating_sum": 0,
          "rating_average": 0.0,
          "site": 1,
          "title": "event search",
          "slug": "event-search",
          "_meta_title": "",
          "description": "event search",
          "gen_description": true,
          "created": "2018-05-25T15:49:55.223Z",
          "updated": "2018-05-25T15:49:55.257Z"
}

And here is my test :

class FrontTest(LiveServerTestCase):

    fixtures = ['event.json']

    @classmethod
    def setUpClass(cls):
        super().setUpClass()
        print(Event.objects.all())

And the output :

[]

Do someone know why my fixture is not loaded ?

Aucun commentaire:

Enregistrer un commentaire