forked from frappe/frappe
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'staging' into production
- Loading branch information
Showing
15 changed files
with
179 additions
and
21 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
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
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
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
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
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 |
---|---|---|
|
@@ -271,6 +271,30 @@ def test_allow_creation_of_new_log_if_the_previous_log_was_reverted(self): | |
self.assertEqual(points_after_reverting_todo, points_after_closing_todo - rule_points) | ||
self.assertEqual(points_after_saving_todo_again, points_after_reverting_todo + rule_points) | ||
|
||
def test_energy_points_disabled_user(self): | ||
frappe.set_user('[email protected]') | ||
user = frappe.get_doc('User', '[email protected]') | ||
user.enabled = 0 | ||
user.save() | ||
todo_point_rule = create_energy_point_rule_for_todo() | ||
energy_point_of_user = get_points('[email protected]') | ||
|
||
created_todo = create_a_todo() | ||
|
||
created_todo.status = 'Closed' | ||
created_todo.save() | ||
points_after_closing_todo = get_points('[email protected]') | ||
|
||
# do not update energy points for disabled user | ||
self.assertEqual(points_after_closing_todo, energy_point_of_user) | ||
|
||
user.enabled = 1 | ||
user.save() | ||
|
||
created_todo.save() | ||
points_after_re_saving_todo = get_points('[email protected]') | ||
self.assertEqual(points_after_re_saving_todo, energy_point_of_user + todo_point_rule.points) | ||
|
||
def create_energy_point_rule_for_todo(multiplier_field=None, for_doc_event='Custom', max_points=None, | ||
for_assigned_users=0, field_to_check=None, apply_once=False, user_field='owner'): | ||
name = 'ToDo Closed' | ||
|
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