<s> import os <EOL> import reversion <EOL> import unittest <EOL> from onadata . apps . main . tests . test_base import TestBase <EOL> from onadata . apps . logger . models import XForm , Instance <EOL> class TestXForm ( TestBase ) : <EOL> def test_submission_count_filters_deleted ( self ) : <EOL> self . _publish_transportation_form_and_submit_instance ( ) <EOL> self . xform = XForm . objects . get ( pk = self . xform . id ) <EOL> self . assertEqual ( self . xform . submission_count ( ) , <NUM_LIT:1> ) <EOL> instance = Instance . objects . get ( xform = self . xform ) <EOL> instance . set_deleted ( ) <EOL> self . assertIsNotNone ( instance . deleted_at ) <EOL> self . xform = XForm . objects . get ( pk = self . xform . id ) <EOL> self . assertEqual ( self . xform . submission_count ( ) , <NUM_LIT:0> ) <EOL> def test_set_title_in_xml_unicode_error ( self ) : <EOL> xls_file_path = os . path . join ( <EOL> os . path . dirname ( os . path . abspath ( __file__ ) ) , <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" <EOL> ) <EOL> self . _publish_xls_file_and_set_xform ( xls_file_path ) <EOL> self . assertTrue ( isinstance ( self . xform . xml , unicode ) ) <EOL> self . xform . title = u'<STR_LIT>' <EOL> self . assertNotIn ( self . xform . title , self . xform . xml ) <EOL> self . xform . xml = self . xform . xml . encode ( '<STR_LIT:utf-8>' ) <EOL> self . assertTrue ( isinstance ( self . xform . xml , str ) ) <EOL> self . xform . _set_title ( ) <EOL> self . assertIn ( self . xform . title , self . xform . xml ) <EOL> @ unittest . skip ( '<STR_LIT>' ) <EOL> def test_reversion ( self ) : <EOL> self . assertTrue ( reversion . is_registered ( XForm ) ) </s>
