Skip to content

Commit

Permalink
test VacancyBL.get_visible
Browse files Browse the repository at this point in the history
  • Loading branch information
anxolerd committed Jul 28, 2015
1 parent 8cd9565 commit 7f3bfb5
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion project/tests/test_bl.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from project.bl import UserBL
from project.tests.utils import ProjectTestCase
from project.extensions import mail
from project.models import User
from project.models import User, Vacancy


class TestUserBL(ProjectTestCase):
Expand Down Expand Up @@ -75,3 +75,27 @@ def test_reset_password(self):
usr,
msg="User was not authenticated with new password"
)


class TestVacancyBL(ProjectTestCase):

def test_get_visible(self):
visible_list = Vacancy.bl.get_visible()
vacancy_list = Vacancy.query.all()

for vacancy in visible_list:
self.assertTrue(
vacancy in vacancy_list,
msg='Vacancy returned by get_visible is not in all vacancies',
)
self.assertFalse(
vacancy.hide,
msg='Vacancy returned by get_visible is hidden',
)
for vacancy in vacancy_list:
if vacancy not in visible_list:
self.assertTrue(
vacancy.hide,
msg='There is a visible vacancy which is not returned'
'with get_visible',
)

0 comments on commit 7f3bfb5

Please sign in to comment.