Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mckinly authored and mckinly committed Oct 2, 2020
1 parent 9732c40 commit 734b43a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 1 addition & 3 deletions django_comments_xtd/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ def get_form():


def get_version():
version = '%s.%s' % (VERSION[0], VERSION[1])
if VERSION[2] is not None:
version = '%s.%s' % (version, VERSION[2])
version = '%s.%s.%s' % (VERSION[0], VERSION[1], VERSION[2])
if VERSION[3] != 'f':
version = '%s%s%s' % (version, VERSION[3], VERSION[4])
return version
5 changes: 5 additions & 0 deletions django_comments_xtd/tests/test_get_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,8 @@ def test_get_version_when_patch_equal_to_zero(self):
def test_get_version_when_patch_greater_than_zero(self):
from django_comments_xtd import get_version
self.assertEqual(get_version(), '2.8.1')

@patch('django_comments_xtd.VERSION', (2, 8, 1, 9, 8))
def test_get_version_when_version_three_not_f(self):
from django_comments_xtd import get_version
self.assertEqual(get_version(), '2.8.198')

0 comments on commit 734b43a

Please sign in to comment.