How to test a django project having postgresql has daabase

I created a project and connected it to postgresql database.
Now how do I test the project using pytest?

When I’m writing
def test_my_user():
nam = Countries.objects.create(name=‘Hi’)
cap = Countries.objects.create(capital=‘Test’)
assert str(nam) == ‘Hi’
It’s giving me: RuntimeError: Database access not allowed, use the “django_db” mark, or the “db” or “transactional_db” fixtures to enable it.

Can someone assist me on the same?

From the error, it looks like you’re using pytest-django. Check the documentation on database acess