@@ -0,0 +1,612 @@
+from django.test import TestCase%0Afrom django.db import IntegrityError%0A%0Afrom rest_api.models import Url%0A%0Aclass UrlTest(TestCase):%0A    def test_create(self):%0A        url = Url.objects.create(long_url='http://hakta.com')%0A        url.save()%0A%0A        self.assertEqual(url.long_url, 'http://hakta.com')%0A        self.assertEqual(url.key, '')%0A%0A    def test_unique(self):%0A        qs = Url.objects.all()%0A        qs.exclude()%0A%0A        url = Url.objects.create(long_url='http://hakta.com')%0A        url.save()%0A%0A        with self.assertRaises(IntegrityError):%0A            url = Url.objects.create(long_url='http://hakta.com')%0A

Add test to models.py