Changeset 7374 for main/waeup.sirp


Ignore:
Timestamp:
18 Dec 2011, 11:20:19 (13 years ago)
Author:
Henrik Bettermann
Message:

We do no longer need get_applicant_data.

Location:
main/waeup.sirp/trunk/src/waeup/sirp/applicants
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/root.py

    r7321 r7374  
    102102        return
    103103
    104 def get_applicant_data(identifier):
    105     """Get applicant data associated with `identifier`.
    106 
    107     Returns the applicant object if successful and ``None`` else.
    108 
    109     As `identifier` we expect an access code in format
    110     like ``PREFIX-XXX-YYYYYYYY`` where ``PREFIX`` is something like
    111     ``APP`` or ``PUDE``, ``XXX`` the access code series and
    112     ``YYYYYYYYYY`` the real accesscode number.
    113 
    114     This function requires a fully blown setup as it does catalog
    115     lookups for finding applicants.
    116     """
    117     query = getUtility(IQuery)
    118     results = list(query.searchResults(
    119             Eq(('applicants_catalog', 'access_code'), identifier)
    120             ))
    121     if len(results) == 0:
    122         return None
    123     return results[0]
    124 
    125104def application_exists(identifier):
    126105    """Check whether an application for the given identifier already
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests/test_root.py

    r7193 r7374  
    218218        self.ac = u'APP-99999'
    219219        self.applicant = Applicant()
    220         self.applicant.access_code = self.ac
     220        #self.applicant.access_code = self.ac
    221221        self.app['applicants']['foo'][self.ac] = self.applicant
    222222        return
     
    233233        result = application_exists('APP-44444')
    234234        assert result is False
    235         return
    236 
    237     def test_get_applicant_data(self):
    238         result = get_applicant_data('APP-99999')
    239         self.assertEqual(result, self.applicant)
    240         return
    241 
    242     def test_get_applicant_data_none(self):
    243         result = get_applicant_data('NOT-EXISTIING')
    244         assert result is None
    245235        return
    246236
Note: See TracChangeset for help on using the changeset viewer.