from django.db import IntegrityError

from django.test import TestCase
from sonotone.models import Album,Artist,Style


class AlbumTestCase(TestCase):
    def setUp(self):
        Artist.objects.create(name="John Bon Jovi")
        Artist.objects.create(name="Led Zeppelin")

    def test_artist_name_is_unique(self):
        with self.assertRaises(IntegrityError):
            Artist.objects.create(name="Led Zeppelin")

20260a2f044785d6692ece544831187ff2f696c0
<mask token>


class AlbumTestCase(TestCase):
    <mask token>
    <mask token>

<mask token>


class AlbumTestCase(TestCase):
    <mask token>

    def test_artist_name_is_unique(self):
        with self.assertRaises(IntegrityError):
            Artist.objects.create(name='Led Zeppelin')

<mask token>


class AlbumTestCase(TestCase):

    def setUp(self):
        Artist.objects.create(name='John Bon Jovi')
        Artist.objects.create(name='Led Zeppelin')

    def test_artist_name_is_unique(self):
        with self.assertRaises(IntegrityError):
            Artist.objects.create(name='Led Zeppelin')

from django.db import IntegrityError
from django.test import TestCase
from sonotone.models import Album, Artist, Style


class AlbumTestCase(TestCase):

    def setUp(self):
        Artist.objects.create(name='John Bon Jovi')
        Artist.objects.create(name='Led Zeppelin')

    def test_artist_name_is_unique(self):
        with self.assertRaises(IntegrityError):
            Artist.objects.create(name='Led Zeppelin')

from django.db import IntegrityError

from django.test import TestCase
from sonotone.models import Album,Artist,Style


class AlbumTestCase(TestCase):
    def setUp(self):
        Artist.objects.create(name="John Bon Jovi")
        Artist.objects.create(name="Led Zeppelin")

    def test_artist_name_is_unique(self):
        with self.assertRaises(IntegrityError):
            Artist.objects.create(name="Led Zeppelin")
