Skip to content

Commit

Permalink
Fix tests with upgrade to Pytest-django 3.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
alexhermida committed Jul 26, 2019
1 parent 61d3a47 commit eba1712
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 8 deletions.
4 changes: 3 additions & 1 deletion tests/integration/test_projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@

from unittest import mock


pytestmark = pytest.mark.django_db(transaction=True)


class ExpiredSigner(signing.TimestampSigner):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
Expand Down Expand Up @@ -279,7 +281,7 @@ def test_task_status_is_closed_changed_recalc_us_is_closed(client):
us_status = f.UserStoryStatusFactory()
user_story = f.UserStoryFactory.create(project=us_status.project, status=us_status)
task_status = f.TaskStatusFactory.create(project=us_status.project, is_closed=False)
task = f.TaskFactory.create(project=us_status.project, status=task_status, user_story=user_story)
f.TaskFactory.create(project=us_status.project, status=task_status, user_story=user_story)

assert user_story.is_closed is False

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from taiga.base.utils import json
from taiga.export_import.services import render_project

pytestmark = pytest.mark.django_db
pytestmark = pytest.mark.django_db(transaction=True)


def test_export_issue_finish_date(client):
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from taiga.base.utils import json
from taiga.export_import.services import render_project, store_project_from_dict

pytestmark = pytest.mark.django_db
pytestmark = pytest.mark.django_db(transaction=True)


def test_import_epic_with_user_stories(client):
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_milestones.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from .. import factories as f
from taiga.projects.milestones import services

pytestmark = pytest.mark.django_db
pytestmark = pytest.mark.django_db(transaction=True)


def test_issues_not_closed():
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_slug.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from taiga.base.utils.slug import slugify

import pytest
pytestmark = pytest.mark.django_db
pytestmark = pytest.mark.django_db(transaction=True)


def test_slugify_1():
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_timeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

import pytest

pytestmark = pytest.mark.django_db
pytestmark = pytest.mark.django_db(transaction=True)

def test_push_to_timeline_many_objects():
with patch("taiga.timeline.service._add_to_object_timeline") as mock:
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_tokens.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from taiga.auth.tokens import get_token_for_user, get_user_for_token


pytestmark = pytest.mark.django_db
pytestmark = pytest.mark.django_db(transaction=True)


def test_valid_token():
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
validate_private_url, IpAddresValueError, HostnameException
from taiga.base.utils.db import save_in_bulk, update_in_bulk, to_tsquery

pytestmark = pytest.mark.django_db
pytestmark = pytest.mark.django_db(transaction=True)


def test_is_absolute_url():
Expand Down

0 comments on commit eba1712

Please sign in to comment.