Commit 51dcdc48 authored by Nicolas Dandrimont's avatar Nicolas Dandrimont

[attributs_tests] paiement et carte etudiant

parent c4a55f5d
......@@ -30,6 +30,11 @@
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# 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
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")
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((
auto_suite(nomTest),
auto_suite(prenomTest),
auto_suite(telTest),
auto_suite(paiementTest),
auto_suite(carteEtudiantTest),
))
if __name__ == "__main__":
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment