Beispiel #1
0
 def setUp(self):
     self.app = create_test_app(app)
     db.create_all()
     initialize_users(with_test_user=True)
     initialize_radios()
     self.test_user = User.query.filter_by(username='******').first()
     self.anonymous_user = HomeberryAnonymousUser()
     self.radio_to_play = Radio.query.filter_by(name='Trójka').first()
     self.radio_to_play2 = Radio.query.filter_by(name='Dwójka').first()
Beispiel #2
0
    def test_db_initialize(self):
        initialize_users(with_test_user=True)
        admin = User.query.filter_by(username='******').first()
        self.assertIsNotNone(admin, "Admin user doesn't exist in database.")
        self.assertTrue(admin.is_active, "Admin user isn't active.")
        self.assertTrue(admin.is_admin, "Admin doesn't have superuser priviledges.")
        self.assertFalse(admin.is_anonymous, "Admin user is anonymous.")
        self.assertTrue(admin.is_authenticated, "Admin user isn't authenticated.")

        # Check test_user
        test_user = User.query.filter_by(username='******').first()
        self.assertIsNotNone(test_user, "Test_user doesn't exist in database.")
        self.assertTrue(test_user.is_active, "Test_user user isn't active.")
        self.assertFalse(test_user.is_admin, "Test_user has superuser priviledges.")
        self.assertFalse(test_user.is_anonymous, "Test_user user is anonymous.")
        self.assertTrue(test_user.is_authenticated, "Test_user user isn't authenticated.")
Beispiel #3
0
 def setUp(self):
     self.app = create_test_app(app)
     db.create_all()
     initialize_users(with_test_user=True)
     self.test_user = User.query.filter_by(username='******').first()