Ejemplo n.º 1
0
    def setUp(self):
        self.cleanUp()

        self.c = Client()

        self.acc1 = User.create_user(email='*****@*****.**', password='******')
        self.acc2 = User.create_user(email='*****@*****.**', password='******')

        self.c.login(email='*****@*****.**', password='******')
Ejemplo n.º 2
0
    def setUp(self):
        User.objects.delete()

        self.c = Client()

        self.test_user = User.create_user(email='*****@*****.**', password='******')
        self.current_user = User.create_user(email='*****@*****.**', password='******')

        self.c.login(email='*****@*****.**', password='******')
Ejemplo n.º 3
0
    def setUp(self):
        self.cleanUp()

        self.c = Client()

        self.acc1 = User.create_user(email='*****@*****.**', password='******')
        self.acc2 = User.create_user(email='*****@*****.**', password='******')

        self.c.login(email='*****@*****.**', password='******')
Ejemplo n.º 4
0
    def setup_users(self):
        self.test_user = User.create_user(email='*****@*****.**', password='******')
        self.current_user = User.create_user(email='*****@*****.**', password='******')
        self.online_users.append(self.current_user)
        self.online_users.append(self.test_user)

        for i in range(USERS_COUNT):
            user = User.create_user(email='*****@*****.**' % i, password='******')
            user.save()
            self.online_users.append(user)
Ejemplo n.º 5
0
 def setUp(self):
     self.tearDown()
     self.c = Client()
     self.user_group_admin = User.create_user(
         email='*****@*****.**', password='******')
     self.user_other = User.create_user(email='*****@*****.**',
                                        password='******')
     self.user_superuser = User.create_user(email='*****@*****.**',
                                            password='******',
                                            is_superuser=True)
Ejemplo n.º 6
0
    def setup_users(self):
        self.test_user = User.create_user(email='*****@*****.**',
                                          password='******')
        self.current_user = User.create_user(email='*****@*****.**',
                                             password='******')
        self.online_users.append(self.current_user)
        self.online_users.append(self.test_user)

        for i in range(USERS_COUNT):
            user = User.create_user(email='*****@*****.**' % i,
                                    password='******')
            user.save()
            self.online_users.append(user)
Ejemplo n.º 7
0
 def setUp(self):
     self.acc1 = User.create_user(email='*****@*****.**',
                                  password='******')
     self.news_object = News(title="test news title",
                             text="test news text",
                             preview_text="test news preview text",
                             author=self.acc1)
     self.news_object.save()
Ejemplo n.º 8
0
 def setUp(self):
     self.acc1 = User.create_user(email='*****@*****.**', password='******')
     self.news_object = News(
         title="test news title",
         text="test news text",
         preview_text="test news preview text",
         author=self.acc1 
     )
     self.news_object.save()
Ejemplo n.º 9
0
    def test_view_file_not_found(self):
        theme = Theme.from_zip(os.path.join(os.path.dirname(__file__),
                                            'files/theme1.zip'))
        client = Client()
        user = User.create_user(email='*****@*****.**', password='******')
        client.login(email='*****@*****.**', password='******')
        response = client.get(reverse('themes:file_view',
                                      kwargs=dict(theme_id=theme.id,
                                                  file_name='not_found.css')
                           ))

        self.failUnlessEqual(404, response.status_code)
Ejemplo n.º 10
0
 def setUp(self):
     self.cleanUp()
     self.c = Client()
     self.user = User.create_user(email='*****@*****.**', password='******')
     self.base_url = reverse('operator')
     self.auth_dict = {
         'duser': settings.PKSPB_DUSER,
         'dpass': settings.PKSPB_DPASS,
         'cid': self.user.id,
         'sid': '1',
     }
     self.TRANS_COUNT = 100
Ejemplo n.º 11
0
    def test_view(self):
        theme = Theme.from_zip(os.path.join(os.path.dirname(__file__),
                                            'files/theme1.zip'))
        client = Client()
        user = User.create_user(email='*****@*****.**', password='******')
        client.login(email='*****@*****.**', password='******')

        response = client.get(reverse('themes:file_view',
                                      kwargs=dict(theme_id=theme.id,
                                                  file_name='style.css')
                           ))

        self.failUnlessEqual(200, response.status_code)

        self.failIfEqual(-1, response.content.find('background-image'))
        self.assertEquals('text/css', response['Content-Type'])
Ejemplo n.º 12
0
    def setUp(self):
        self.tearDown()

        self.client = Client()

        self.camera_type_axis = CameraType(
            name='Axis',
            driver='axis.AxisDriver',
            is_controlled=False,
        )
        self.camera_type_axis.save()
        self.camera_type_axis_manage = CameraType(
            name='Axis Manage',
            driver='axis.AxisDriver',
            is_controlled=True,
        )
        self.camera_type_axis_manage.save()

        self.tariff_view_package = Tariff(
            name='View Package 1 min',
            description='View Package Description...',
            cost=1.0,
            duration=2,
            is_controlled=False,
        )
        self.tariff_view_package.save()

        self.tariff_view_time = Tariff(
            name='View Package Time',
            description='View Package Description...',
            cost=1.0,
            is_controlled=False,
        )
        self.tariff_view_time.save()

        self.tariff_manage_package = Tariff(
            name='Manage Package 1 min',
            description='Manage Package Description...',
            cost=2.0,
            duration=2,
            is_controlled=True,
        )
        self.tariff_manage_package.save()

        self.tariff_manage_time = Tariff(
            name='Manage Package Time',
            description='Manage Package Description...',
            cost=2.0,
            is_controlled=True,
        )
        self.tariff_manage_time.save()

        for i in xrange(1, 4):
            user = User.create_user(email='*****@*****.**' % i, password='******')
            user.cash = 1000000.0
            user.save()
            camera = Camera(
                name='Test Billing Camera %i' % i,
                owner=user,
                type=self.camera_type_axis_manage,
                stream_name='boston',
                camera_management_host='localhost.boston.com',
                camera_management_username='******',
                camera_management_password='******',
                is_view_enabled=True,
                is_view_public=True,
                is_view_paid=True,
                is_management_enabled=True,
                is_management_public=True,
                is_management_paid=True,
                is_managed=True,
                management_packet_tariff=self.tariff_manage_package,
                management_time_tariff=self.tariff_manage_time,
                view_packet_tariff=self.tariff_view_package,
                view_time_tariff=self.tariff_view_time,
            )
            camera.save()
Ejemplo n.º 13
0
 def setUp(self):
     self.tearDown()
     self.c = Client()
     self.user_group_admin = User.create_user(email='*****@*****.**', password='******')
     self.user_other = User.create_user(email='*****@*****.**', password='******')
     self.user_superuser = User.create_user(email='*****@*****.**', password='******', is_superuser=True)