Beispiel #1
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')
Beispiel #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
Beispiel #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')
Beispiel #4
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