Commit b6d6bfd5b086ad3055536385bf5bab1c92b71a9d

Authored by Etienne Pallier
1 parent d243a3ef
Exists in dev

petit bugfix

Showing 1 changed file with 9 additions and 1 deletions   Show diff stats
src/majordome/majordome_test.py
... ... @@ -66,6 +66,7 @@ def execProcessAsync(command):
66 66 return p
67 67  
68 68 def execProcessFromVenvSync(command: str):
  69 + print(f"Execute command from venv as a process: {command}")
69 70 command = venv_bin + ' ' + command
70 71 args = command.split()
71 72 process = subprocess.Popen(args)
... ... @@ -91,9 +92,16 @@ def init_database():
91 92 # Go into src/
92 93 #os.chdir('..')
93 94 print("Current directory : " + str(os.getcwd()))
  95 + # If executed the very first time, it raises errors, so executes it later
  96 + #execProcessFromVenvSync("manage.py flush --noinput")
  97 + execProcessFromVenvSync("manage.py makemigrations")
  98 + execProcessFromVenvSync("manage.py migrate")
  99 + # Executed here, it is ok
94 100 execProcessFromVenvSync("manage.py flush --noinput")
  101 + # Do we really need now to make migrations and to migrate again (a second time) ? (not sure)
95 102 execProcessFromVenvSync("manage.py makemigrations")
96 103 execProcessFromVenvSync("manage.py migrate")
  104 + # Load fixture:
97 105 execProcessFromVenvSync("manage.py loaddata misc" + os.sep + "fixtures" + os.sep + fixture)
98 106  
99 107 def getConfigFromDB():
... ... @@ -139,7 +147,7 @@ replacePatternInFileOrError("MAJORDOME_TEST = False", "MAJORDOME_TEST = True", "
139 147 #os.chdir('majordome')
140 148  
141 149  
142   -i+=1; print_step_message(i, 'Init database')
  150 +i+=1; print_step_message(i, 'Init test database')
143 151 init_database()
144 152  
145 153  
... ...