mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Skip some git hash checks if running tests under docker
This commit is contained in:
parent
47269a88d2
commit
206da02328
@ -5,6 +5,7 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
from allauth.account.models import EmailAddress
|
from allauth.account.models import EmailAddress
|
||||||
|
|
||||||
|
from django.conf import settings
|
||||||
from django.contrib.auth import get_user_model
|
from django.contrib.auth import get_user_model
|
||||||
|
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
@ -67,11 +68,21 @@ class TemplateTagTest(TestCase):
|
|||||||
|
|
||||||
def test_hash(self):
|
def test_hash(self):
|
||||||
result_hash = inventree_extras.inventree_commit_hash()
|
result_hash = inventree_extras.inventree_commit_hash()
|
||||||
self.assertGreater(len(result_hash), 5)
|
if settings.DOCKER:
|
||||||
|
# Testing inside docker environment *may* return an empty git commit hash
|
||||||
|
# In such a case, skip this check
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
self.assertGreater(len(result_hash), 5)
|
||||||
|
|
||||||
def test_date(self):
|
def test_date(self):
|
||||||
d = inventree_extras.inventree_commit_date()
|
d = inventree_extras.inventree_commit_date()
|
||||||
self.assertEqual(len(d.split('-')), 3)
|
if settings.DOCKER:
|
||||||
|
# Testing inside docker environment *may* return an empty git commit hash
|
||||||
|
# In such a case, skip this check
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
self.assertEqual(len(d.split('-')), 3)
|
||||||
|
|
||||||
def test_github(self):
|
def test_github(self):
|
||||||
self.assertIn('github.com', inventree_extras.inventree_github_url())
|
self.assertIn('github.com', inventree_extras.inventree_github_url())
|
||||||
|
Loading…
Reference in New Issue
Block a user