Different models order in main.django_content_type table during unittesting

Viewed 26

I'm using django 3.1 with SQLite DB. I'm using my django project as API, so django rest framework is installed as well. During my unittest (with pycharm) I've observed that in table main.django_content_type some models in my dev DB and test DB are ordered differently and have different IDs. For example defaultcategory and customcategory:

dev DB:

  1. admin logentry
  2. auth permission
  3. auth group
  4. contenttypes contenttype
  5. sessions session
  6. core customuser
  7. core historicalcustomuser
  8. authtoken token
  9. authtoken historicaltoken
  10. finances fixtransaction
  11. finances historicaldefaultcategory
  12. finances historicaltransfer
  13. finances historicaltransaction
  14. finances transaction
  15. finances fixtransfer
  16. finances historicalfixtransfer
  17. finances historicalcostaccount
  18. finances historicalfixtransaction
  19. finances transfer
  20. finances costaccount
  21. finances historicalcustomcategory
  22. finances defaultcategory
  23. finances customcategory

test DB:

  1. admin | log entry
  2. auth | permission
  3. auth | group
  4. contenttypes | content type
  5. sessions | session
  6. core | custom user
  7. core | historical custom user
  8. finances | cost account
  9. finances | transfer
  10. finances | transaction
  11. finances | historical transfer
  12. finances | historical transaction
  13. finances | historical fix transfer
  14. finances | historical fix transaction
  15. finances | historical default category
  16. finances | historical custom category
  17. finances | historical cost account
  18. finances | fix transfer
  19. finances | fix transaction
  20. finances | default category
  21. finances | custom category
  22. authtoken | Token
  23. authtoken | historical Token

Is there any way to sort all model during the test in the same way they are in dev DB?

0 Answers
Related