-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from moshthepitt/day-count
Implement better leave day count
- Loading branch information
Showing
9 changed files
with
94 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
"""Main init file for small_small_hr.""" | ||
VERSION = (0, 3, 0) | ||
VERSION = (0, 4, 0) | ||
__version__ = ".".join(str(v) for v in VERSION) | ||
# pylint: disable=invalid-name | ||
default_app_config = "small_small_hr.apps.SmallSmallHrConfig" # noqa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
small_small_hr/templates/small_small_hr/email/leave_application_email_body.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
small_small_hr/templates/small_small_hr/email/leave_application_email_body.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
small_small_hr/templates/small_small_hr/email/leave_completed_email_body.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
small_small_hr/templates/small_small_hr/email/leave_completed_email_body.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
"""Module to test small_small_hr models.""" | ||
# pylint: disable=too-many-lines | ||
# pylint: disable=too-many-lines,hard-coded-auth-user | ||
import os | ||
from datetime import date, datetime, timedelta | ||
|
||
|
@@ -11,6 +11,7 @@ | |
|
||
import pytz | ||
from model_mommy import mommy | ||
from model_mommy.recipe import Recipe | ||
from model_reviews.models import ModelReview | ||
|
||
from small_small_hr.forms import ( | ||
|
@@ -39,6 +40,17 @@ class TestForms(TestCase): # pylint: disable=too-many-public-methods | |
def setUp(self): | ||
"""Set up test class.""" | ||
self.factory = RequestFactory() | ||
StaffProfile.objects.rebuild() | ||
self.manager = mommy.make( | ||
"auth.User", first_name="Jane", last_name="Ndoe", email="[email protected]" | ||
) | ||
self.user = mommy.make( | ||
"auth.User", first_name="Bob", last_name="Ndoe", email="[email protected]" | ||
) | ||
manager_mommy = Recipe(StaffProfile, lft=None, rght=None, user=self.manager) | ||
staff_mommy = Recipe(StaffProfile, lft=None, rght=None, user=self.user) | ||
self.manager_profile = manager_mommy.make() | ||
self.staffprofile = staff_mommy.make() | ||
|
||
def test_annual_leave_form(self): | ||
"""Test AnnualLeaveForm.""" | ||
|
@@ -1266,11 +1278,9 @@ def test_staff_profile_admin_create_form(self): | |
|
||
def test_staff_profile_admin_form(self): | ||
"""Test StaffProfileAdminForm.""" | ||
manager = mommy.make("auth.User", username="manager") | ||
managerprofile = mommy.make("small_small_hr.StaffProfile", user=manager) | ||
|
||
user = mommy.make("auth.User") | ||
staffprofile = mommy.make("small_small_hr.StaffProfile", user=user) | ||
managerprofile = self.manager_profile | ||
user = self.user | ||
staffprofile = self.staffprofile | ||
|
||
request = self.factory.get("/") | ||
request.session = {} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters