Skip to content

Commit

Permalink
Configure tests to use media_store and uploads in current directory.
Browse files Browse the repository at this point in the history
Signed-off-by: Oleg Girko <[email protected]>
  • Loading branch information
Oleg Girko committed Nov 13, 2022
1 parent 8b713da commit 95a42d8
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/config/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,19 @@ def generate_config(self):
],
)

with open(self.config_file, "r") as f:
contents = f.readlines()
newcontents = []
for l in contents:
if l.startswith("media_store_path: "):
newcontents.append('media_store_path: "%s"\n' % os.path.abspath("media_store"))
elif l.startswith("uploads_path: "):
newcontents.append('uploads_path: "%s"\n' % os.path.abspath("uploads"))
else:
newcontents.append(l)
with open(self.config_file, "w") as f:
f.write("".join(newcontents))

def generate_config_and_remove_lines_containing(self, needle):
self.generate_config()

Expand Down

0 comments on commit 95a42d8

Please sign in to comment.