Пример #1
0
    def setUp(self):

       u = get_user_model()()
       u.id = 1
       u.username = '******'
       u.first_name = 'test'
       u.last_name = 'test'
       u.email = 'test'
       u.set_password('test') 
       u.save()

       p = Provider()
       p.id = 1
       p.user = u
       p.name = "test"  
       p.email = "*****@*****.**" 
       p.phone = 12312312
       p.currency = "USD"
       p.language = "DE"
       p.save()

       a = Area()
       a.id = 1
       a.name = "test"
       a.price = 10.20
       a.provider = p
       a.poly = '{ "type": "Polygon", "coordinates": [ [ [0, 0], [10, 50], [10, 0], [0, 0] ] ] }'
       a.save()

       u = get_user_model()()
       u.id = 2
       u.username = '******'
       u.first_name = 'test2'
       u.last_name = 'test2'
       u.email = '*****@*****.**'
       u.set_password('test') 
       u.save()

       p = Provider()
       p.id = 2
       p.user = u
       p.name = "test2"  
       p.email = "*****@*****.**" 
       p.phone = 123123212
       p.currency = "USD"
       p.language = "EN"
       p.save()

       a = Area()
       a.id = 2
       a.name = "test2"
       a.price = 10.20
       a.provider = p
       a.poly = '{ "type": "Polygon", "coordinates": [ [ [0, 0], [10, 50], [10, 0], [0, 0] ] ] }'
       a.save()

       self.url = reverse("area:area-detail",kwargs={"pk":1})
Пример #2
0
    def setUp(self):

       u = get_user_model()()
       u.id = 1
       u.username = '******'
       u.first_name = 'test'
       u.last_name = 'test'
       u.email = '*****@*****.**'
       u.set_password('test') 
       u.save()

       p = Provider()
       p.id = 1
       p.user = u
       p.name = "test"  
       p.email = "*****@*****.**" 
       p.phone = 12312312
       p.currency = "USD"
       p.language = "DE"
       p.save()

       u = get_user_model()()
       u.id = 2
       u.username = '******'
       u.first_name = 'test2'
       u.last_name = 'test2'
       u.email = '*****@*****.**'
       u.set_password('test') 
       u.save()

       p = Provider()
       p.id = 2
       p.user = u
       p.name = "test2"  
       p.email = "*****@*****.**" 
       p.phone = 123123212
       p.currency = "USD"
       p.language = "EN"
       p.save()

       self.url = reverse("area:area-list")