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

pylint not project

parent 8d1836aa
import unittest
from django.test import Client
from django.contrib.auth.models import User
from projects.models import Project, Task
......@@ -11,8 +10,10 @@ from home.templatetags.home_extras import (
get_task_statuses,
get_user_task_statuses)
from test_helpers import (create_test_user, delete_test_data,
create_multiple_test_data, create_task_status_data)
from test_helpers import (
delete_test_data,
create_multiple_test_data,
create_task_status_data)
class OfferCountingRegressionTest(unittest.TestCase):
......
from django.shortcuts import render, redirect
from pprint import pprint
from projects.models import Project
def home(request):
if (request.user.is_authenticated):
if request.user.is_authenticated:
user = request.user
user_projects = Project.objects.filter(user=user.profile)
customer_projects = list(Project.objects.filter(
......
from django import forms
from .models import Payment
class PaymentForm(forms.Form):
......
......@@ -2,6 +2,6 @@ from django.urls import path
from . import views
urlpatterns = [
path('<project_id>/<task_id>', views.payment, name='payment'),
path('<project_id>/<task_id>', views.handle_payment, name='payment'),
path('<project_id>/<task_id>/receipt/', views.receipt, name='receipt'),
]
from django.shortcuts import render, redirect
from django.contrib.auth.decorators import login_required
from .models import Payment
from projects.models import Project, Task
from projects.templatetags.project_extras import get_accepted_task_offer
from .forms import PaymentForm
from django.contrib.auth.decorators import login_required
from .models import Payment
@login_required
def payment(request, project_id, task_id):
def handle_payment(request, project_id, task_id):
if request.method == 'POST':
task = Task.objects.get(pk=task_id)
......
from django import forms
from django.contrib.auth.models import User
from projects.models import ProjectCategory
from django.contrib.auth.forms import UserCreationForm
from projects.models import ProjectCategory
class SignUpForm(UserCreationForm):
......
import unittest
from django.test import Client
from django.contrib.auth.models import User
from projects.models import ProjectCategory
from test_helpers import delete_test_data
class SignUpRegressionTest(unittest.TestCase):
def setUp(self):
self.client = Client()
self.nr_of_users = User.objects.count()
category = ProjectCategory.objects.create(name='Category')
self.test_data = {
'username': 'username',
'first_name': 'firstname',
'last_name': 'lastname',
'categories': category.id,
'company': 'company',
'email': 'user@example.com',
'email_confirmation': 'user@example.com',
'password1': 'veryDifficult123',
'password2': 'veryDifficult123',
'phone_number': '987654321',
'country': 'Country',
'state': 'State',
'city': 'City',
'postal_code': '1234',
'street_address': 'Street 1'
}
def tearDown(self):
delete_test_data()
def test_signup_post(self):
response = self.client.post(
'/user/signup/', self.test_data, follow=True)
self.assertTrue(('/', 302) in response.redirect_chain)
def test_signup_get(self):
response = self.client.get('/user/signup/')
self.assertIsNotNone(response.context['form'])
from django.urls import path
from . import views
from django.contrib.auth import views as auth_views
from . import views
urlpatterns = [
path(
......
from django.http import HttpResponse
from projects.models import ProjectCategory
from django.contrib import messages
from django.contrib.auth import login, authenticate
from django.contrib.auth.forms import UserCreationForm
from django.shortcuts import render, redirect, get_object_or_404
from django.contrib.auth import authenticate
from django.shortcuts import render, redirect
from .forms import SignUpForm
......
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