Commit c3672129 authored by Michal Čihař's avatar Michal Čihař

Clone from remote just once

parent 606bc5c2
......@@ -26,6 +26,7 @@ from django.test import TestCase
from django.conf import settings
import shutil
import os
import git
from weblate.trans.models import (
Project, SubProject
)
......@@ -37,9 +38,20 @@ class RepoTestCase(TestCase):
'''
def setUp(self):
if 'test-repos' in settings.GIT_ROOT:
if os.path.exists(settings.GIT_ROOT):
shutil.rmtree(settings.GIT_ROOT)
self.repo_path = 'git://github.com/nijel/weblate-test.git'
test_dir = os.path.join(settings.GIT_ROOT, 'test')
if os.path.exists(test_dir):
shutil.rmtree(test_dir)
self.repo_path = os.path.join(settings.GIT_ROOT, 'test-repo.git')
# Clone repo for testing just once
if not os.path.exists(self.repo_path):
cmd = git.Git()
cmd.clone(
'--bare',
'git://github.com/nijel/weblate-test.git',
self.repo_path
)
def create_project(self):
'''
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment