Fixed tests
parent
5e184120f7
commit
4e9d4610fe
|
@ -1,3 +1,5 @@
|
|||
import uuid
|
||||
|
||||
from django.core.urlresolvers import reverse
|
||||
|
||||
from taiga.projects.issues.serializers import IssueSerializer
|
||||
|
@ -36,15 +38,18 @@ def data():
|
|||
m.public_project = f.ProjectFactory(is_private=False,
|
||||
anon_permissions=list(map(lambda x: x[0], ANON_PERMISSIONS)),
|
||||
public_permissions=list(map(lambda x: x[0], USER_PERMISSIONS)),
|
||||
owner=m.project_owner)
|
||||
owner=m.project_owner,
|
||||
issues_csv_uuid=uuid.uuid4().hex)
|
||||
m.private_project1 = f.ProjectFactory(is_private=True,
|
||||
anon_permissions=list(map(lambda x: x[0], ANON_PERMISSIONS)),
|
||||
public_permissions=list(map(lambda x: x[0], USER_PERMISSIONS)),
|
||||
owner=m.project_owner)
|
||||
owner=m.project_owner,
|
||||
issues_csv_uuid=uuid.uuid4().hex)
|
||||
m.private_project2 = f.ProjectFactory(is_private=True,
|
||||
anon_permissions=[],
|
||||
public_permissions=[],
|
||||
owner=m.project_owner)
|
||||
owner=m.project_owner,
|
||||
issues_csv_uuid=uuid.uuid4().hex)
|
||||
|
||||
m.public_membership = f.MembershipFactory(project=m.public_project,
|
||||
user=m.project_member_with_perms,
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import uuid
|
||||
|
||||
from django.core.urlresolvers import reverse
|
||||
|
||||
from taiga.base.utils import json
|
||||
|
@ -35,15 +37,18 @@ def data():
|
|||
m.public_project = f.ProjectFactory(is_private=False,
|
||||
anon_permissions=list(map(lambda x: x[0], ANON_PERMISSIONS)),
|
||||
public_permissions=list(map(lambda x: x[0], USER_PERMISSIONS)),
|
||||
owner=m.project_owner)
|
||||
owner=m.project_owner,
|
||||
tasks_csv_uuid=uuid.uuid4().hex)
|
||||
m.private_project1 = f.ProjectFactory(is_private=True,
|
||||
anon_permissions=list(map(lambda x: x[0], ANON_PERMISSIONS)),
|
||||
public_permissions=list(map(lambda x: x[0], USER_PERMISSIONS)),
|
||||
owner=m.project_owner)
|
||||
owner=m.project_owner,
|
||||
tasks_csv_uuid=uuid.uuid4().hex)
|
||||
m.private_project2 = f.ProjectFactory(is_private=True,
|
||||
anon_permissions=[],
|
||||
public_permissions=[],
|
||||
owner=m.project_owner)
|
||||
owner=m.project_owner,
|
||||
tasks_csv_uuid=uuid.uuid4().hex)
|
||||
|
||||
m.public_membership = f.MembershipFactory(project=m.public_project,
|
||||
user=m.project_member_with_perms,
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import uuid
|
||||
|
||||
from django.core.urlresolvers import reverse
|
||||
|
||||
from taiga.base.utils import json
|
||||
|
@ -35,15 +37,18 @@ def data():
|
|||
m.public_project = f.ProjectFactory(is_private=False,
|
||||
anon_permissions=list(map(lambda x: x[0], ANON_PERMISSIONS)),
|
||||
public_permissions=list(map(lambda x: x[0], USER_PERMISSIONS)),
|
||||
owner=m.project_owner)
|
||||
owner=m.project_owner,
|
||||
userstories_csv_uuid=uuid.uuid4().hex)
|
||||
m.private_project1 = f.ProjectFactory(is_private=True,
|
||||
anon_permissions=list(map(lambda x: x[0], ANON_PERMISSIONS)),
|
||||
public_permissions=list(map(lambda x: x[0], USER_PERMISSIONS)),
|
||||
owner=m.project_owner)
|
||||
owner=m.project_owner,
|
||||
userstories_csv_uuid=uuid.uuid4().hex)
|
||||
m.private_project2 = f.ProjectFactory(is_private=True,
|
||||
anon_permissions=[],
|
||||
public_permissions=[],
|
||||
owner=m.project_owner)
|
||||
owner=m.project_owner,
|
||||
userstories_csv_uuid=uuid.uuid4().hex)
|
||||
|
||||
m.public_membership = f.MembershipFactory(project=m.public_project,
|
||||
user=m.project_member_with_perms,
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import uuid
|
||||
|
||||
from unittest import mock
|
||||
|
||||
from django.core.urlresolvers import reverse
|
||||
|
@ -175,7 +177,7 @@ def test_get_invalid_csv(client):
|
|||
|
||||
def test_get_valid_csv(client):
|
||||
url = reverse("issues-csv")
|
||||
project = f.ProjectFactory.create()
|
||||
project = f.ProjectFactory.create(issues_csv_uuid=uuid.uuid4().hex)
|
||||
|
||||
response = client.get("{}?uuid={}".format(url, project.issues_csv_uuid))
|
||||
assert response.status_code == 200
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import uuid
|
||||
|
||||
from unittest import mock
|
||||
|
||||
from django.core.urlresolvers import reverse
|
||||
|
@ -124,7 +126,7 @@ def test_get_invalid_csv(client):
|
|||
|
||||
def test_get_valid_csv(client):
|
||||
url = reverse("tasks-csv")
|
||||
project = f.ProjectFactory.create()
|
||||
project = f.ProjectFactory.create(tasks_csv_uuid=uuid.uuid4().hex)
|
||||
|
||||
response = client.get("{}?uuid={}".format(url, project.tasks_csv_uuid))
|
||||
assert response.status_code == 200
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
import copy
|
||||
import uuid
|
||||
|
||||
from unittest import mock
|
||||
from django.core.urlresolvers import reverse
|
||||
|
||||
|
@ -255,7 +257,7 @@ def test_get_invalid_csv(client):
|
|||
|
||||
def test_get_valid_csv(client):
|
||||
url = reverse("userstories-csv")
|
||||
project = f.ProjectFactory.create()
|
||||
project = f.ProjectFactory.create(userstories_csv_uuid=uuid.uuid4().hex)
|
||||
|
||||
response = client.get("{}?uuid={}".format(url, project.userstories_csv_uuid))
|
||||
assert response.status_code == 200
|
||||
|
|
Loading…
Reference in New Issue