MCPcopy
hub / github.com/django/django / get_unused_country_id

Method get_unused_country_id

tests/bulk_create/tests.py:901–905  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

899 available_apps = ["bulk_create"]
900
901 def get_unused_country_id(self):
902 # Find a serial ID that hasn't been used already and has enough of a
903 # buffer for the following `bulk_create` call without an explicit pk
904 # not to conflict.
905 return getattr(Country.objects.last(), "id", 10) + 100
906
907 def test_no_unnecessary_transaction(self):
908 unused_id = self.get_unused_country_id()

Calls 1

lastMethod · 0.80

Tested by

no test coverage detected