How to run django unit-tests on production database?

前端 未结 5 1226
面向向阳花
面向向阳花 2020-11-29 00:56

i\'m starting the TDD development attitude and am writting unit-tests for my django application. I\'m aware of fixtures and know that\'s the way tests should be executed, bu

5条回答
  •  孤城傲影
    2020-11-29 01:15

    Not a good idea, but if you know what you are doing (basically breaking your production) you can check this setting:

    https://docs.djangoproject.com/en/2.2/ref/settings/#test

    DATABASES = {
      'default': {
         ...
         'TEST': {
            'NAME': 'your prod db'
         }
    }
    

提交回复
热议问题