@pytest.mark.django_db
def test_data_tp_bad():
 with pytest.raises(IntegrityError):
  TPData.objects.create()

@ pytest . mark . django_db def test_data_tp_bad ( ) : with pytest . raises ( IntegrityError ) : TPData . objects . create ( )
test that you cant add a duplicate file extension .