# -*- encoding: utf-8 -*-
from django.test import TestCase
from assets.models import Gallery, Medium

from .factories import MediumFactory


class ModelsTestCase(TestCase):
    """
        Tests Assets Models
    """

    def setUp(self):
        # create place
        self.medium = MediumFactory()

    def tearDown(self):
        pass

    def test_gallery(self):
        "simple TEST gallery"
        # get gallery
        galleries = Gallery.objects.all()
        # test gallerie created
        self.assertEqual(galleries.count(), 1)

    def test_medium(self):
        "simple TEST medium"
        # get gallery
        media = Medium.objects.all()
        # test medium created
        self.assertEqual(media.count(), 1)

@@ -1,62 +1,18 @@
-# -*- encoding: utf-8 -*-%0Afrom django.test import TestCase
+import pytest%0A
 %0Afro
@@ -94,38 +94,47 @@
 y%0A%0A%0A
-class ModelsTestCase(TestCase)
+@pytest.mark.django_db%0Aclass TestModels
 :%0A  
@@ -175,17 +175,16 @@
     %22%22%22%0A
-%0A
     def 
@@ -190,9 +190,9 @@
  set
-U
+u
 p(se
@@ -200,31 +200,8 @@
 f):%0A
-        # create place%0A
     
@@ -249,14 +249,18 @@
 f te
-arDown
+st_gallery
 (sel
@@ -275,360 +275,440 @@
     
-pass%0A%0A    def test_gallery(self):%0A        %22simple TEST gallery%22%0A        # get gallery%0A        galleries = Gallery.objects.all()%0A        # test gallerie created%0A        self.assertEqual(galleries.count(), 1)%0A%0A    def test_medium(self):%0A        %22simple TEST medium%22%0A        # get gallery%0A        media = Medium.objects.all()%0A        # test medium created
+galleries = Gallery.objects.all()%0A        assert galleries.count() == 1%0A%0A    def test_gallery_str(self):%0A        assert self.medium.gallery.label in str(self.medium.gallery)%0A        assert self.medium.gallery.description in str(self.medium.gallery)%0A%0A    def test_medium(self):%0A        media = Medium.objects.all()%0A        assert media.count() == 1%0A%0A    def test_medium_str(self):%0A        assert self.medium.label in str(self.medium)
 %0A   
@@ -716,39 +716,55 @@
     
-self.
 assert
-Equal(media.count(), 1
+ self.medium.description in str(self.medium
 )%0A

test common models; moves to pytests