i am finding it kinda confusing to do unit testing especially with fields that has blank=True attribute or unique=True
look at this for example:
class TagTest(TestCase):
def create(self):
tag = models.Tag.objects.create(name='test')
return tag
def test_get(self):
tag = self.create()
self.assertIsInstance(tag, models.Tag)
self.assertEqual(tag.name, tag.__str__())
self.assertEqual(len(tag.name),4)class TagTest(TestCase):
def create(self):
tag = models.Tag.objects.create(name='test')
return tag
def test_get(self):
tag = self.create()
self.assertIsInstance(tag, models.Tag)
self.assertEqual(tag.name, tag.__str__())
self.assertEqual(len(tag.name),4)
look at coverage for example, it is telling me i am not covering the test case at all
