Exemple #1
0
def safe_date_add(startdate, days, force_to_date_flag=True):
    if not startdate:  return None
    try: 
        val = startdate + timedelta(days)
        if force_to_date_flag:  return force_to_date(val)
        else:                   return val 
    except OverflowError, e:
        log_exception(e) 
        return None
Exemple #2
0
def safe_date_add(startdate, days, force_to_date_flag=True):
    if not startdate:  return None
    try: 
        val = startdate + timedelta(days)
        if force_to_date_flag:  return force_to_date(val)
        else:                   return val 
    except OverflowError, e:
        log_exception(e) 
        return None
Exemple #3
0
from dimagi.utils.logging import log_exception
try:
    from .test_repeater import *
    from .test_submissions import *
    from .test_submit_errors import *
    from .test_url_regex import *
except ImportError, e:
    # for some reason the test harness squashes these so log them here for clarity
    # otherwise debugging is a pain
    log_exception(e)
    raise (e)
Exemple #4
0
from dimagi.utils.logging import log_exception
try:
    from .test_ota_restore import *
    from .test_state_hash import *
    from .test_sync_logs import *
    from .test_sync_mode import *
except ImportError, e:
    # for some reason the test harness squashes these so log them here for clarity
    # otherwise debugging is a pain
    log_exception(e)
    raise(e)

# doctest
from casexml.apps.phone.checksum import Checksum
__test__ = {
    'checksum': Checksum
}