Remove unused TO code.
This commit is contained in:
@@ -1,31 +0,0 @@
|
||||
import pytest
|
||||
from flask import url_for
|
||||
from io import BytesIO
|
||||
import re
|
||||
from zipfile import ZipFile
|
||||
|
||||
from atst.utils.docx import Docx
|
||||
|
||||
from tests.factories import TaskOrderFactory, PortfolioFactory, UserFactory
|
||||
|
||||
|
||||
def xml_translated(val):
|
||||
val = re.sub("'", "'", str(val))
|
||||
val = re.sub(" & ", " & ", str(val))
|
||||
return val
|
||||
|
||||
|
||||
def test_download_summary(client, user_session):
|
||||
user = UserFactory.create()
|
||||
portfolio = PortfolioFactory.create(owner=user)
|
||||
task_order = TaskOrderFactory.create(creator=user, portfolio=portfolio, _pdf=None)
|
||||
user_session(user)
|
||||
response = client.get(
|
||||
url_for("task_orders.download_summary", task_order_id=task_order.id)
|
||||
)
|
||||
bytes_str = BytesIO(response.data)
|
||||
zip_ = ZipFile(bytes_str, mode="r")
|
||||
doc = zip_.read(Docx.DOCUMENT_FILE).decode()
|
||||
for attr, val in task_order.to_dictionary().items():
|
||||
assert attr in doc
|
||||
assert xml_translated(val) in doc
|
@@ -123,13 +123,3 @@ class TestPortfolioFunding:
|
||||
_, context = templates[0]
|
||||
assert context["funding_end_date"] is expiring_to.end_date
|
||||
assert context["funded"] == False
|
||||
|
||||
def test_user_can_only_access_to_in_their_portfolio(
|
||||
self, app, user_session, portfolio
|
||||
):
|
||||
other_task_order = TaskOrderFactory.create()
|
||||
user_session(portfolio.owner)
|
||||
response = app.test_client().get(
|
||||
url_for("task_orders.view_task_order", task_order_id=other_task_order.id)
|
||||
)
|
||||
assert response.status_code == 404
|
||||
|
@@ -1,6 +0,0 @@
|
||||
from flask import url_for
|
||||
|
||||
from atst.domain.task_orders import TaskOrders
|
||||
from tests.factories import UserFactory, TaskOrderFactory, PortfolioFactory
|
||||
|
||||
# TODO: add tests!
|
Reference in New Issue
Block a user