Commit 83081505 authored by Ola Hermann Opheim's avatar Ola Hermann Opheim
Browse files

minor dev fixing

parent 0aeae5b1
from user.models import Profile
from projects.models import Task,ProjectCategory
from projects.models import Task, ProjectCategory
from django.core import mail
from django.shortcuts import get_object_or_404
from django.contrib.sites.shortcuts import get_current_site
......
from django import template
from django.contrib.auth.models import User
from django.core.exceptions import ObjectDoesNotExist
from ..models import TaskOffer
register = template.Library()
......
from django.shortcuts import get_object_or_404
from django.utils import timezone
from projects.models import Task, TaskOffer, Delivery, Team, TaskFileTeam
from projects.forms import EditTaskOfferForm, EditProjectForm, TaskOfferForm, TaskOfferResponseForm, TaskDeliveryResponseForm, DeliveryForm, TeamForm, TeamAddForm
from projects.models import Delivery, Team, TaskFileTeam
from projects.forms import TaskDeliveryResponseForm, DeliveryForm, TeamForm, TeamAddForm
def delivery_handler(request, task):
deliver_form = DeliveryForm(request.POST, request.FILES)
......
from django.contrib import messages
from projects.models import Task, TaskOffer, TaskFileTeam, directory_path
from projects.forms import EditTaskOfferForm, EditProjectForm, TaskOfferForm, TaskOfferResponseForm, TaskFileForm
from projects.models import TaskFileTeam, directory_path
from projects.forms import TaskFileForm
def file_upload_and_access_handler(request, project, task, user_permissions):
accepted_task_offer = task.accepted_task_offer()
......
import unittest
from django.test import Client
from projects.models import Project, ProjectCategory, Task, TaskOffer
from projects.models import Project, ProjectCategory, Task
from test_helpers import create_test_user, delete_test_data
......
......@@ -4,7 +4,7 @@ from django.test import Client
from user.models import User
from projects.models import Project, Task, TaskOffer
from test_helpers import create_test_user, delete_test_data, create_multiple_test_data
from test_helpers import delete_test_data, create_multiple_test_data
class ProjectViewStatementTest(unittest.TestCase):
def setUp(self):
......
import unittest
from django.test import Client
from user.models import User
from projects.models import Project, Task, TaskOffer, Delivery, Team
from test_helpers import create_test_user, delete_test_data, create_multiple_test_data, create_delivery
from test_helpers import delete_test_data, create_multiple_test_data, create_delivery
class TaskViewRegressionTest(unittest.TestCase):
def setUp(self):
......@@ -54,11 +53,3 @@ class TaskViewRegressionTest(unittest.TestCase):
team = Team.objects.get(name="Name")
self.assertEquals(team.task, self.task)
def test_post_permissions(self):
# TODO
pass
def test_post_team_add(self):
# TODO: maybe
pass
from django.http import HttpResponse, HttpResponseRedirect
from user.models import Profile
from .models import Project, Task, TaskFile, TaskOffer, Delivery, ProjectCategory, Team, TaskFileTeam
from .forms import EditTaskOfferForm, EditProjectForm, ProjectForm, TaskFileForm, ProjectStatusForm, TaskOfferForm, TaskOfferResponseForm, TaskPermissionForm, DeliveryForm, TaskDeliveryResponseForm, TeamForm, TeamAddForm, SortForm
from django.shortcuts import render, redirect, get_object_or_404
from .forms import (ProjectForm, TaskFileForm, ProjectStatusForm, TaskOfferForm, TaskOfferResponseForm,
TaskPermissionForm, DeliveryForm, TaskDeliveryResponseForm, TeamForm, TeamAddForm, SortForm)
from django.shortcuts import render, redirect
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from .templatetags.projects_extras import sort_projects
from .templatetags.new_project_extras import create_new_project
from .templatetags.project_view_extras import offer_response_handler, edit_project_handler, offer_submit_handler, edit_offer_handler
from .templatetags.project_view_extras import (offer_response_handler, edit_project_handler,
offer_submit_handler, edit_offer_handler)
from .templatetags.upload_extras import file_upload_and_access_handler
from .templatetags.task_permissions_extras import can_modify_permissions, change_permissions
from .templatetags.task_view_extras import delivery_handler, delivery_response_handler, team_handler, team_add_handler, permissions_handler
from .templatetags.task_view_extras import (delivery_handler, delivery_response_handler,
team_handler, team_add_handler, permissions_handler)
def projects(request):
......
......@@ -2,7 +2,9 @@ from django.test import Client
from django.contrib.auth.models import User
from projects.models import Project, ProjectCategory, Task, TaskOffer
from user.models import Profile
from projects.models import (Projects, Project, ProjectCategory,
Task, TaskOffer, Delivery, TaskFile, TaskFileTeam, Team)
from payment.models import Payment
def create_test_user():
......@@ -32,8 +34,6 @@ def create_task_status_data():
)
def create_projects_sorting_data():
#create_multiple_test_data()
test_user_a = User.objects.create_user(
username='A User',
email='test@test.com',
......@@ -183,10 +183,17 @@ def create_delivery():
def delete_test_data():
User.objects.all().delete()
Profile.objects.all().delete()
ProjectCategory.objects.all().delete()
Projects.objects.all().delete()
Project.objects.all().delete()
Task.objects.all().delete()
TaskOffer.objects.all().delete()
TaskFile
TaskFileTeam
Team
Delivery.objects.all().delete()
Payment.objects.all().delete()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment