Beispiel #1
0
 def test_when_title_is_more_than_max_length_should_raise_error(self):
     job = Job(
         title=
         'Lorem Ipsum is simply dummy text of the printing and typesetting industry. '
         'Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, '
         'when an unknown printer took a galley of type and scrambled it to make a type '
         'specimen book. It has survived not only five centuries, but also the leap into '
         'electronic typesetting, remaining essentially unchanged. It was popularised in '
         'the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, '
         'and more recently with desktop publishing software like Aldus PageMaker '
         'including versions of Lorem Ipsum.',
         experience=1,
         salary_min=5000.00,
         salary_max=10000.00,
         qualification=self.qualification,
         job_gender=self.job_gender,
         application_deadline='',
         description='Test job',
         responsibilities='Web developer',
         education='Computer Science',
         other_benefits='Apple Watch',
         company=self.company,
         latitude=3.00,
         longitude=4.00,
     )
     with self.assertRaises(ValidationError):
         job.full_clean(exclude=exclude)
Beispiel #2
0
 def test_when_title_is_null_should_raise_error(self):
     job = Job(
         experience=1,
         salary_min=5000.00,
         salary_max=10000.00,
         qualification=self.qualification,
         job_gender=self.job_gender,
         application_deadline='',
         description='Test job',
         responsibilities='Web developer',
         education='Computer Science',
         other_benefits='Apple Watch',
         company=self.company,
         latitude=3.00,
         longitude=4.00,
     )
     with self.assertRaises(ValidationError):
         job.full_clean(exclude=exclude)
Beispiel #3
0
 def test_when_everything_is_given_should_pass(self):
     job = Job(
         title='Software Engineer',
         experience=1,
         salary_min=5000.00,
         salary_max=10000.00,
         qualification=self.qualification,
         job_gender=self.job_gender,
         application_deadline='',
         description='Test job',
         responsibilities='Web developer',
         education='Computer Science',
         other_benefits='Apple Watch',
         company=self.company,
         latitude=3.00,
         longitude=4.00,
     )
     try:
         job.full_clean(exclude=exclude)
     except:
         self.fail()