2👍
✅
Function argument evaluates once at the definition time so you shouldn’t use any calculations in the def
statement. Workaround for this situation is:
def createTestProduct(product_group="VG", opno=None):
if opno is None:
opno = "MyProduct%s" % Product.objects.count()
...
Source:stackexchange.com