I am new to Django REST Api testing and I am running an error like this raise ValueError('Related model %r cannot be resolved' % self.remote_field.model) ValueError: Related model 'auth.Group' cannot be resolved when running a test, and im not sure why this happen
I ran into the same issue when switching to custom User model mid-project. The trick is that you will need to add the below auth dependency before creating your custom user model operation
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0012_alter_user_first_name_max_length'), # this is the missing part
]
operations = [
migrations.CreateModel(
.... # your custom user create model operation
),
]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With