From 1a2d31e1c59427c28211030ea09cd4964b4bd8d8 Mon Sep 17 00:00:00 2001 From: adityacp Date: Tue, 16 Feb 2021 15:21:24 +0530 Subject: Change test data files, views, models, template - Fix upload marks for a quiz column missing error - Add upload marks task to celery - Minor fixes to avoid errors in regrade and custom_filters --- yaksh/test_views.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'yaksh/test_views.py') diff --git a/yaksh/test_views.py b/yaksh/test_views.py index 58b7506..ccd2fbc 100644 --- a/yaksh/test_views.py +++ b/yaksh/test_views.py @@ -23,7 +23,6 @@ from django.core.files.uploadedfile import SimpleUploadedFile from django.core.files import File from django.contrib.messages import get_messages from django.contrib.contenttypes.models import ContentType -from celery.contrib.testing.worker import start_worker from django.test import SimpleTestCase @@ -41,6 +40,8 @@ from online_test.celery_settings import app from notifications_plugin.models import Notification +app.conf.update(CELERY_ALWAYS_EAGER=True) + class TestUserRegistration(TestCase): def setUp(self): @@ -4418,9 +4419,6 @@ class TestGrader(SimpleTestCase): end_time=timezone.now()+timezone.timedelta(minutes=20), ) - self.celery_worker = start_worker(app) - self.celery_worker.__enter__() - def tearDown(self): User.objects.all().delete() Course.objects.all().delete() @@ -4429,7 +4427,6 @@ class TestGrader(SimpleTestCase): QuestionPaper.objects.all().delete() AnswerPaper.objects.all().delete() self.mod_group.delete() - self.celery_worker.__exit__(None, None, None) def test_regrade_denies_anonymous(self): # Given -- cgit