<s> from __future__ import unicode_literals <EOL> import frappe , unittest <EOL> import frappe . desk . form . assign_to <EOL> class TestAssign ( unittest . TestCase ) : <EOL> def test_assign ( self ) : <EOL> todo = frappe . get_doc ( { "<STR_LIT>" : "<STR_LIT>" , "<STR_LIT:description>" : "<STR_LIT:test>" } ) . insert ( ) <EOL> if not frappe . db . exists ( "<STR_LIT>" , "<STR_LIT>" ) : <EOL> frappe . get_doc ( { "<STR_LIT>" : "<STR_LIT>" , "<STR_LIT:email>" : "<STR_LIT>" , "<STR_LIT>" : "<STR_LIT>" } ) . insert ( ) <EOL> added = frappe . desk . form . assign_to . add ( { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : todo . doctype , <EOL> "<STR_LIT:name>" : todo . name , <EOL> "<STR_LIT:description>" : todo . description , <EOL> } ) <EOL> self . assertTrue ( "<STR_LIT>" in [ d . owner for d in added ] ) <EOL> removed = frappe . desk . form . assign_to . remove ( todo . doctype , todo . name , "<STR_LIT>" ) <EOL> self . assertTrue ( "<STR_LIT>" not in [ d . owner for d in removed ] ) </s>
