Changeset 6641
- Timestamp:
- Jan 25, 2009, 11:53:59 PM (16 years ago)
- Location:
- trunk/exodus/tests
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/exodus/tests/base.py
r6637 r6641 19 19 loc3 = Location.objects.create(description = 'Lepelenburg', 20 20 latitude = '37.12345', longitude = '48.12345') 21 loc4 = Location.objects.create(description = 'Neude',22 latitude = '57.12345', longitude = '58.12345')23 21 24 22 # We assume the wleiden.net network is already created via initial_data. -
trunk/exodus/tests/test_forms.py
r6608 r6641 3 3 from exodus.tests.base import BootstrapTestCase 4 4 5 class FormsTest(BootstrapTestCase): 5 class LocationFormTest(BootstrapTestCase): 6 7 def test_location_form(self): 8 from exodus.forms import LocationForm 9 data = { 'description': 'Locatie Descriptie', 10 'latitude':12.34567, 'longitude':13.45676} 11 form = LocationForm(data) 12 self.assertTrue(form.is_valid()) 13 form.save() 14 from exodus.models import Location 15 loc = Location.objects.get(description='Locatie Descriptie') 16 self.assertEquals(loc.pk, 4) 17 import decimal as D 18 self.assertEquals(loc.latitude, D.Decimal("12.34567")) 19 self.assertEquals(loc.longitude, D.Decimal("13.45676")) 20 21 class NodeFormTest(BootstrapTestCase): 22 pass 23 24 class InterfaceFormTest(BootstrapTestCase): 25 pass 26 27 class DhcpStaticFormTest(BootstrapTestCase): 6 28 pass 7 29 8 30 def suite(): 9 31 s = unittest.TestSuite() 10 s.addTest(unittest.makeSuite(FormsTest)) 32 s.addTest(unittest.makeSuite(LocationFormTest)) 33 s.addTest(unittest.makeSuite(NodeFormTest)) 34 s.addTest(unittest.makeSuite(InterfaceFormTest)) 35 s.addTest(unittest.makeSuite(DhcpStaticFormTest)) 11 36 return s
Note:
See TracChangeset
for help on using the changeset viewer.