예제 #1
0
파일: test_location.py 프로젝트: skner/TS
def save_location(self):
    l = Location()
    l.defaultlocation = True
    l.name = 'HomeTest'
    l.save()
    self.assertIsNotNone(l.id, 'Location id is None')
    return l
예제 #2
0
def save_location(self):
    l = Location()
    l.defaultlocation = True
    l.name = 'HomeTest'
    l.save()
    self.assertIsNotNone(l.id, 'Location id is None')
    return l
예제 #3
0
    def test_save_method(self):
        l = Location()
        l.defaultlocation = True
        l.name = 'HomeTest'
        l.save()
        _id = l.id

        l = Location()
        l.defaultlocation = True
        l.name = 'HomeTest'
        l.save()

        for l in Location.objects.exclude(id=l.id):
            self.assertFalse(l.defaultlocation, 'Should not be default location, only one is allowed')
예제 #4
0
파일: test_location.py 프로젝트: skner/TS
    def test_save_method(self):
        l = Location()
        l.defaultlocation = True
        l.name = 'HomeTest'
        l.save()
        _id = l.id

        l = Location()
        l.defaultlocation = True
        l.name = 'HomeTest'
        l.save()

        for l in Location.objects.exclude(id=l.id):
            self.assertFalse(
                l.defaultlocation,
                'Should not be default location, only one is allowed')