Esempio n. 1
0
    def test_matching_of_skills(self):
        """Test matching of the skills values."""

        query = ResumesQuery({'skills': [1]})
        response = query.list()
        self.assertEqual([item.id for item in response],
                         [self.resume_1.id, self.resume_3.id])
Esempio n. 2
0
    def test_matching_of_salary_value(self):
        """Test matching of the salary value."""

        query = ResumesQuery({'salary': {'min': 120000, 'max': 250000}})
        response = query.list()
        self.assertEqual(
            [item.id for item in response],
            [self.resume_2.id, self.resume_3.id, self.resume_4.id])
Esempio n. 3
0
    def test_list_of_resumes_with_wrong_order(self):
        """Return list of resumes with the wrong order value."""

        query = ResumesQuery({'order': 'company'})
        response = query.list()
        self.assertEqual([item.id for item in response], [
            self.resume_1.id, self.resume_2.id, self.resume_3.id,
            self.resume_4.id
        ])
Esempio n. 4
0
    def test_opposite_list_order(self):
        """Return list of resumes with opposite order."""

        query = ResumesQuery({'order': '-salary'})
        response = query.list()
        self.assertEqual([item.id for item in response], [
            self.resume_2.id, self.resume_4.id, self.resume_3.id,
            self.resume_1.id
        ])
Esempio n. 5
0
    def test_matching_the_order_of_list(self):
        """Return list of resumes with specific order."""

        query = ResumesQuery({'order': 'salary'})
        response = query.list()
        self.assertEqual([item.id for item in response], [
            self.resume_1.id, self.resume_3.id, self.resume_4.id,
            self.resume_2.id
        ])
Esempio n. 6
0
    def test_matching_of_skills_if_empty(self):
        """Test returning of the default skills value."""

        query = ResumesQuery({'skills': []})
        response = query.list()
        self.assertEqual([item.id for item in response], [
            self.resume_1.id, self.resume_2.id, self.resume_3.id,
            self.resume_4.id
        ])
Esempio n. 7
0
    def test_receiving_of_the_resumes_list(self):
        """Test success receiving of the resumes list without any parameter."""

        query = ResumesQuery({})
        response = query.list()
        self.assertEqual([item.id for item in response], [
            self.resume_1.id, self.resume_2.id, self.resume_3.id,
            self.resume_4.id
        ])
Esempio n. 8
0
    def test_matching_of_salary_if_min_is_empty(self):
        """Test matching of the salary if max key is empty."""

        query = ResumesQuery({'salary': {
            'min': 180000,
        }})
        response = query.list()
        self.assertEqual([item.id for item in response], [
            self.resume_1.id, self.resume_2.id, self.resume_3.id,
            self.resume_4.id
        ])