From f19287da47d09e75a945c44f79b1e08e3cb0a8a5 Mon Sep 17 00:00:00 2001 From: Antonis Kalipetis Date: Mon, 14 Sep 2015 17:38:18 +0300 Subject: [PATCH] Added test for correct git SHA The default behavior of `fetch_git_sha` should be to fetch the SHA of the active branch - if any - and not the master branch. --- tests/versioning/tests.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/versioning/tests.py b/tests/versioning/tests.py index cef37109..96eb0603 100644 --- a/tests/versioning/tests.py +++ b/tests/versioning/tests.py @@ -2,6 +2,7 @@ from __future__ import absolute_import import os.path import pytest +import subprocess from django.conf import settings @@ -19,6 +20,9 @@ def test_fetch_git_sha(): assert result is not None assert len(result) == 40 assert isinstance(result, six.string_types) + assert result == subprocess.check_output( + 'git rev-parse --verify HEAD', shell=True, cwd=settings.PROJECT_ROOT + ).strip() def test_fetch_package_version():