Commit 9c3cde63 authored by Einar Uvsløkk's avatar Einar Uvsløkk
Browse files

Merge branch 'backend/refactor/dead-code' into 'master'

Remove dead code from backend

See merge request !27
parents 1ac71e98 0ba3fa4c
Pipeline #127912 passed with stages
in 2 minutes and 52 seconds
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.urls import reverse
from workouts.models import Workout
......
from django.test import TestCase
# Create your tests here.
from django.urls import include
from django.urls import path
from rest_framework.urlpatterns import format_suffix_patterns
from comments.models import Comment
from comments.models import Like
from comments.views import CommentDetail
from comments.views import CommentList
from comments.views import LikeDetail
......
from django.db.models import Q
from django.shortcuts import render
from rest_framework import generics
from rest_framework import mixins
from rest_framework import permissions
......@@ -109,7 +108,6 @@ class LikeDetail(
queryset = Like.objects.all()
serializer_class = LikeSerializer
permission_classes = [permissions.IsAuthenticated]
_Detail = []
def get(self, request, *args, **kwargs):
return self.retrieve(request, *args, **kwargs)
......
from django.test import TestCase
from rest_framework.test import APIClient
from rest_framework.test import force_authenticate
import util
from users.models import User
......
from django.test import TestCase
from rest_framework.test import APIClient
from rest_framework.test import force_authenticate
import util
from users.models import User
......
from django.test import TestCase
from rest_framework.test import APIClient
from rest_framework.test import force_authenticate
import util
from users.models import User
......
from django.test import TestCase
from django.utils import timezone
from rest_framework.test import APIClient
from rest_framework.test import force_authenticate
from users.models import User
from users.serializers import UserSerializer
from workouts.models import Exercise
from workouts.serializers import ExerciseSerializer
......
import os
import time
from pathlib import Path
from django.contrib.auth import get_user_model
......
......@@ -89,7 +89,7 @@ class WorkoutBoundaryValuesTest(BlackBoxTestServer):
user = login_data["athlete"]
self.login(user)
results = {"valid": [], "invalid": []}
for category, data in data_sets.items():
for data in data_sets.values():
self.get("workout.html")
self.populate_workout_form(**data)
self.driver.find_element(By.ID, "btn-ok-workout").click()
......
......@@ -111,4 +111,4 @@ class UserSerializerTest(TestCase):
self.assertFalse(hasattr(user, "password1"))
for attr, value in data.items():
if attr not in ["password", "password1"]:
self.assertEqual(getattr(user, attr), data[attr])
self.assertEqual(getattr(user, attr), value)
from django.urls import include
from django.urls import path
from rest_framework.urlpatterns import format_suffix_patterns
from users import views
......
import django
from django.contrib.auth import get_user_model
from django.db.models import Q
from django.shortcuts import get_object_or_404
from rest_framework import generics
from rest_framework import mixins
from rest_framework import permissions
from rest_framework.parsers import FormParser
from rest_framework.parsers import MultiPartParser
from rest_framework.permissions import AllowAny
from rest_framework.permissions import IsAdminUser
from rest_framework.permissions import IsAuthenticated
from rest_framework.permissions import IsAuthenticatedOrReadOnly
from users.models import AthleteFile
......@@ -100,7 +95,6 @@ class OfferList(
serializer.save(owner=self.request.user)
def get_queryset(self):
qs = Offer.objects.none()
result = Offer.objects.none()
if self.request.user:
......
......@@ -3,7 +3,6 @@
These are mostly class-based views.
"""
import base64
import json
import pickle
from collections import namedtuple
from operator import attrgetter
......
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