コード例 #1
0
ファイル: test_viewset.py プロジェクト: sam-berg/OpenSlides
 def setUp(self):
     self.client = APIClient()
     config['general_system_enable_anonymous'] = True
     config.save_default_values()
     for index in range(10):
         Assignment.objects.create(title='motion{}'.format(index),
                                   open_posts=1)
コード例 #2
0
 def setUp(self):
     self.client = APIClient()
     config['general_system_enable_anonymous'] = True
     config.save_default_values()
     user = User.objects.get(pk=1)
     for index in range(10):
         ChatMessage.objects.create(user=user)
コード例 #3
0
ファイル: test_viewset.py プロジェクト: Intevation/OpenSlides
 def setUp(self):
     self.client = APIClient()
     config['general_system_enable_anonymous'] = True
     config.save_default_values()
     user = User.objects.get(pk=1)
     for index in range(10):
         ChatMessage.objects.create(user=user)
コード例 #4
0
ファイル: test_views.py プロジェクト: Intevation/OpenSlides
 def setUp(self):
     # Save the old value of the config object and add the test values
     # TODO: Can be changed to setUpClass when Django 1.8 is no longer supported
     self._config_values = config.config_variables.copy()
     config.key_to_id = {}
     config.update_config_variables(set_simple_config_view_integration_config_test())
     config.save_default_values()
コード例 #5
0
 def setUp(self):
     # Save the old value of the config object and add the test values
     # TODO: Can be changed to setUpClass when Django 1.8 is no longer supported
     self._config_values = config.config_variables.copy()
     config.key_to_id = None
     config.update_config_variables(set_simple_config_view_integration_config_test())
     config.save_default_values()
コード例 #6
0
 def setUp(self):
     self.client = APIClient()
     config['general_system_enable_anonymous'] = True
     config.save_default_values()
     for index in range(10):
         Motion.objects.create(title='motion{}'.format(index))
         get_user_model().objects.create_user(
             username='******'.format(index), password='******')
コード例 #7
0
def test_config_db_queries():
    """
    Tests that only the following db queries are done:
    * 1 requests to get the list of all config values
    """
    config.save_default_values()

    assert count_queries(Tag.get_elements)() == 1
コード例 #8
0
def test_config_db_queries():
    """
    Tests that only the following db queries are done:
    * 1 requests to get the list of all config values
    """
    config.save_default_values()

    assert count_queries(Tag.get_elements) == 1
コード例 #9
0
 def setUp(self):
     self.client = APIClient()
     config['general_system_enable_anonymous'] = True
     config.save_default_values()
     for index in range(10):
         Mediafile.objects.create(title='some_file{}'.format(index),
                                  mediafile=SimpleUploadedFile(
                                      'some_file{}'.format(index),
                                      b'some content.'))
コード例 #10
0
ファイル: test_viewset.py プロジェクト: Intevation/OpenSlides
 def setUp(self):
     self.client = APIClient()
     config['general_system_enable_anonymous'] = True
     config.save_default_values()
     for index in range(10):
         Mediafile.objects.create(
             title='some_file{}'.format(index),
             mediafile=SimpleUploadedFile(
                 'some_file{}'.format(index),
                 b'some content.'))
コード例 #11
0
ファイル: test_config.py プロジェクト: Intevation/OpenSlides
 def setUp(self):
     # Save the old value of the config object and add the test values
     # TODO: Can be changed to setUpClass when Django 1.8 is no longer supported
     self._config_values = config.config_variables.copy()
     config.update_config_variables(set_grouped_config_view())
     config.update_config_variables(set_simple_config_view())
     config.update_config_variables(set_simple_config_view_multiple_vars())
     config.update_config_variables(set_simple_config_collection_disabled_view())
     config.update_config_variables(set_simple_config_collection_with_callback())
     config.save_default_values()
コード例 #12
0
 def setUp(self):
     # Save the old value of the config object and add the test values
     # TODO: Can be changed to setUpClass when Django 1.8 is no longer supported
     self._config_values = config.config_variables.copy()
     config.update_config_variables(set_grouped_config_view())
     config.update_config_variables(set_simple_config_view())
     config.update_config_variables(set_simple_config_view_multiple_vars())
     config.update_config_variables(set_simple_config_collection_disabled_view())
     config.update_config_variables(set_simple_config_collection_with_callback())
     config.save_default_values()
コード例 #13
0
 def setUp(self):
     self.client = APIClient()
     config['general_system_enable_anonymous'] = True
     config.save_default_values()
     for index in range(10):
         Group.objects.create(name='group{}'.format(index))
コード例 #14
0
ファイル: test_viewset.py プロジェクト: Intevation/OpenSlides
 def setUp(self):
     self.client = APIClient()
     config['general_system_enable_anonymous'] = True
     config.save_default_values()
コード例 #15
0
ファイル: test_viewset.py プロジェクト: Intevation/OpenSlides
 def setUp(self):
     self.client = APIClient()
     config['general_system_enable_anonymous'] = True
     config.save_default_values()
     for index in range(10):
         User.objects.create(username='******'.format(index))
コード例 #16
0
 def setUp(self):
     self.client = APIClient()
     config.save_default_values()
     config['general_system_enable_anonymous'] = True
コード例 #17
0
ファイル: test_viewset.py プロジェクト: Intevation/OpenSlides
 def setUp(self):
     self.client = APIClient()
     config['general_system_enable_anonymous'] = True
     config.save_default_values()
     for index in range(10):
         Topic.objects.create(title='topic-{}'.format(index))