removing imports.py and increasing coverage
This commit is contained in:
@@ -26,6 +26,7 @@ pytestmark = pytest.mark.django_db
|
||||
|
||||
from bs4 import BeautifulSoup
|
||||
import re
|
||||
import pytz
|
||||
from parameterized import parameterized
|
||||
|
||||
from django.test import TestCase, Client,override_settings, RequestFactory, TransactionTestCase
|
||||
@@ -34,6 +35,8 @@ from django.core.management import call_command
|
||||
from django.core.files.uploadedfile import SimpleUploadedFile
|
||||
|
||||
from io import StringIO
|
||||
import factory
|
||||
from factory.fuzzy import FuzzyDateTime
|
||||
|
||||
from django.test.client import RequestFactory
|
||||
from rowers.integrations import *
|
||||
@@ -41,7 +44,7 @@ from rowers.integrations import *
|
||||
from rowers.forms import (
|
||||
DocumentsForm,CNsummaryForm,RegistrationFormUniqueEmail,
|
||||
ChartParamChoiceForm,WorkoutMultipleCompareForm,
|
||||
BoxPlotChoiceForm,PerformanceManagerForm,
|
||||
BoxPlotChoiceForm,PerformanceManagerForm,ForceCurveOptionsForm
|
||||
)
|
||||
import rowers.plots as plots
|
||||
import rowers.interactiveplots as iplots
|
||||
@@ -94,7 +97,7 @@ from rowers.models import *
|
||||
from rowers.forms import *
|
||||
from rowers.tests.mocks import *
|
||||
import factory
|
||||
from faker import Factory
|
||||
from faker import Factory, Faker
|
||||
from uuid import uuid4
|
||||
faker = Factory.create()
|
||||
|
||||
@@ -181,13 +184,18 @@ class RaceFactory(factory.DjangoModelFactory):
|
||||
sessionvalue = 1
|
||||
sessionmode = 'time'
|
||||
|
||||
|
||||
fake = Faker()
|
||||
now = datetime.datetime.now(tz=pytz.timezone("America/New_York"))
|
||||
one_month_ago = now - datetime.timedelta(days=30)
|
||||
|
||||
class WorkoutFactory(factory.DjangoModelFactory):
|
||||
class Meta:
|
||||
model = Workout
|
||||
|
||||
name = factory.LazyAttribute(lambda _: faker.word())
|
||||
notes = faker.text()
|
||||
startdatetime = get_random_file(name=faker.word())['startdatetime']
|
||||
startdatetime = FuzzyDateTime(start_dt=one_month_ago, force_year=datetime.date.today().year)
|
||||
starttime = get_random_file(name=faker.word())['starttime']
|
||||
workouttype='water'
|
||||
date=timezone.now().date()
|
||||
|
||||
Reference in New Issue
Block a user