Skip to content

Commit

Permalink
- Using randbits to generate pk to get around confilcting sequence pks
Browse files Browse the repository at this point in the history
  • Loading branch information
elipe17 committed Jul 10, 2023
1 parent 29fa8b8 commit ac9b065
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tdrs-backend/tdpservice/stts/test/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import factory
from ..models import STT, Region
import random


class RegionFactory(factory.django.DjangoModelFactory):
Expand All @@ -12,7 +13,7 @@ class Meta:

model = "stts.Region"

id = factory.Sequence(int)
id = random.getrandbits(16)

@classmethod
def _create(cls, model_class, *args, **kwargs):
Expand Down

0 comments on commit ac9b065

Please sign in to comment.