Revert to old method of sample data gen

bulk_create is super quick, but no autoincrement on sqlite is killer when trying to run tests.
This commit is contained in:
2021-02-07 14:40:15 +00:00
parent 788fb3efe6
commit ef1d9868da
15 changed files with 324 additions and 339 deletions

View File

@@ -29,4 +29,15 @@ def splinter_screenshot_dir():
def vat_rate(db):
vat_rate = VatRate.objects.create(start_at='2014-03-05', rate=0.20, comment='test1')
yield vat_rate
vat_rate.delete()
vat_rate.delete()
def _has_transactional_marker(item):
db_marker = item.get_closest_marker("django_db")
if db_marker and db_marker.kwargs.get("transaction"):
return 1
return 0
def pytest_collection_modifyitems(items):
items.sort(key=_has_transactional_marker)