Skip to content

Commit

Permalink
Merge pull request #44 from antonioIrizar/dev
Browse files Browse the repository at this point in the history
Release 1.0.1
  • Loading branch information
antonioIrizar authored May 24, 2020
2 parents ee6f37b + bb91725 commit e033cf4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion django_check_migration_wtf/github_migrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def __init__(self, commit_hash: str, base_branch: str):
self.g = Github(settings.CHECK_MIGRATION_WTF_GITHUB_TOKEN)
self.repo: Repository = self.g.get_repo(settings.CHECK_MIGRATION_WTF_REPO_NAME)
self.comp: Comparison = self.repo.compare(base_branch, commit_hash)
self.migration_name_regex = re.compile(r'(?P<path>.*)/migrations/(?P<migration_name>.*).py\Z')
self.migration_name_regex = re.compile(r'(?P<path>.*)/migrations/(?P<migration_name>(?!__init__.py).*).py\Z')

@property
def migrations(self) -> List[Tuple[str, str]]:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setup(
name='django-check-migration-wtf',
version='1.0.0',
version='1.0.1',
packages=find_packages(),
description='A line of description',
long_description=README,
Expand Down
5 changes: 4 additions & 1 deletion tests/unit/test_github_migrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ def test_get_migration_name(self, filename, github_migrations):
@pytest.mark.parametrize('filename',
['test/bad_migrations/0001_32524.py',
'test/migrations/0001_32524.py.back',
'test/migrations/0001_32524', ]
'test/migrations/0001_32524',
'test/migrations/__init__.py',
]
)
def test_get_migration_name_return_none(self, filename, github_migrations):
assert github_migrations.get_migration_name(filename) is None
Expand All @@ -29,6 +31,7 @@ def test_get_migration_name_return_none(self, filename, github_migrations):
(GithubMigrations.FILE_STATUS_ADDED, '/test/migrations/bad', []),
(GithubMigrations.FILE_STATUS_ADDED, '/test/migrations/0001_32524.py', [('/test/migrations/0001_32524.py', '0001_32524')]),
(GithubMigrations.FILE_STATUS_MODIFIED, '/test/migrations/0001_32524.py', [('/test/migrations/0001_32524.py', '0001_32524')]),
(GithubMigrations.FILE_STATUS_MODIFIED, '/test/migrations/__init__0001_32524.py', [('/test/migrations/__init__0001_32524.py', '__init__0001_32524')]),
]
)
def test_migration(self, status, filename, expected, github_migrations):
Expand Down

0 comments on commit e033cf4

Please sign in to comment.