[attributs_tests] paiement et carte etudiant
This commit is contained in:
parent
c4a55f5dc5
commit
51dcdc4847
1 changed files with 26 additions and 0 deletions
|
@ -30,6 +30,11 @@
|
||||||
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
import sys as _sys
|
||||||
|
_sys.path.append('/usr/scripts/gestion')
|
||||||
|
del _sys
|
||||||
|
|
||||||
|
import config
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from lc_ldap_tests import LDAPTest, auto_suite
|
from lc_ldap_tests import LDAPTest, auto_suite
|
||||||
|
@ -84,10 +89,31 @@ class telTest(LDAPTest):
|
||||||
attr = self.attrify_light(u"+42 (0) 1 23456789", "tel")
|
attr = self.attrify_light(u"+42 (0) 1 23456789", "tel")
|
||||||
self.assertEqual(str(attr), "0042123456789")
|
self.assertEqual(str(attr), "0042123456789")
|
||||||
|
|
||||||
|
class yearTest(LDAPTest):
|
||||||
|
"""Tests sur des champs entiers"""
|
||||||
|
tests = ["acceptInt"]
|
||||||
|
field = None
|
||||||
|
def acceptInt(self):
|
||||||
|
"""Accepte les entiers prédéfinis"""
|
||||||
|
self.attrify_light(u"1999", self.field)
|
||||||
|
self.attrify_light(u"2008", self.field)
|
||||||
|
self.assertRaises(ValueError, self.attrify_light, u"1990", self.field)
|
||||||
|
self.assertRaises(ValueError, self.attrify_light, unicode(config.ann_scol+1), self.field)
|
||||||
|
|
||||||
|
class paiementTest(yearTest):
|
||||||
|
"""Tests sur l'attribut paiement"""
|
||||||
|
field = "paiement"
|
||||||
|
|
||||||
|
class carteEtudiantTest(yearTest):
|
||||||
|
"""Tests sur l'attribut paiement"""
|
||||||
|
field = "carteEtudiant"
|
||||||
|
|
||||||
TEST_SUITE = unittest.TestSuite((
|
TEST_SUITE = unittest.TestSuite((
|
||||||
auto_suite(nomTest),
|
auto_suite(nomTest),
|
||||||
auto_suite(prenomTest),
|
auto_suite(prenomTest),
|
||||||
auto_suite(telTest),
|
auto_suite(telTest),
|
||||||
|
auto_suite(paiementTest),
|
||||||
|
auto_suite(carteEtudiantTest),
|
||||||
))
|
))
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue