from django.test import TestCase

from testapp.tests import factories


class SchedulingTestCase(TestCase):
    def test_scheduling(self):
        for i in range(20):
            factories.AssignmentFactory.create()
            factories.WaitListFactory.create()

        admin = factories.UserFactory.create(is_staff=True, is_superuser=True)
        self.client.login(username=admin.username, password='test')

        self.client.get('/zivinetz/admin/scheduling/')

from django.test import TestCase

from zivinetz.models import Assignment

from testapp.tests import factories


class SchedulingTestCase(TestCase):
    def test_scheduling(self):
        for i in range(20):
            factories.AssignmentFactory.create()
            factories.WaitListFactory.create()

        admin = factories.UserFactory.create(is_staff=True, is_superuser=True)
        self.client.login(username=admin.username, password='test')

        self.assertEqual(
            self.client.get('/zivinetz/admin/scheduling/').status_code,
            200)

        Assignment.objects.all().delete()
        self.assertEqual(
            self.client.get('/zivinetz/admin/scheduling/').status_code,
            200)

Test that scheduling does not crash
Test that scheduling does not crash

  from django.test import TestCase
+ 
+ from zivinetz.models import Assignment
  
  from testapp.tests import factories
  
  
  class SchedulingTestCase(TestCase):
      def test_scheduling(self):
          for i in range(20):
              factories.AssignmentFactory.create()
              factories.WaitListFactory.create()
  
          admin = factories.UserFactory.create(is_staff=True, is_superuser=True)
          self.client.login(username=admin.username, password='test')
  
+         self.assertEqual(
-         self.client.get('/zivinetz/admin/scheduling/')
+             self.client.get('/zivinetz/admin/scheduling/').status_code,
+             200)
  
+         Assignment.objects.all().delete()
+         self.assertEqual(
+             self.client.get('/zivinetz/admin/scheduling/').status_code,
+             200)
+ 
Test that scheduling does not crash
## Code Before:
from django.test import TestCase

from testapp.tests import factories


class SchedulingTestCase(TestCase):
    def test_scheduling(self):
        for i in range(20):
            factories.AssignmentFactory.create()
            factories.WaitListFactory.create()

        admin = factories.UserFactory.create(is_staff=True, is_superuser=True)
        self.client.login(username=admin.username, password='test')

        self.client.get('/zivinetz/admin/scheduling/')

## Instruction:
Test that scheduling does not crash
## Code After:
from django.test import TestCase

from zivinetz.models import Assignment

from testapp.tests import factories


class SchedulingTestCase(TestCase):
    def test_scheduling(self):
        for i in range(20):
            factories.AssignmentFactory.create()
            factories.WaitListFactory.create()

        admin = factories.UserFactory.create(is_staff=True, is_superuser=True)
        self.client.login(username=admin.username, password='test')

        self.assertEqual(
            self.client.get('/zivinetz/admin/scheduling/').status_code,
            200)

        Assignment.objects.all().delete()
        self.assertEqual(
            self.client.get('/zivinetz/admin/scheduling/').status_code,
            200)
