Exemplo n.º 1
0
    def test_adding_registration_to_dashboard_increases_json_size_by_one(self, mock_from_kwargs):
        mock_from_kwargs.return_value = Auth(user=self.user)

        with app.test_request_context():
            url = api_url_for('get_dashboard')

        res = self.app.get(url + ALL_MY_REGISTRATIONS_ID)
        init_len = len(res.json[u'data'])

        RegistrationFactory(creator=self.user)
        res = self.app.get(url + ALL_MY_REGISTRATIONS_ID)
        assert_equal(len(res.json[u'data']), init_len + 1)
Exemplo n.º 2
0
    def test_adding_registration_to_dashboard_increases_json_size_by_one(self, mock_from_kwargs):
        mock_from_kwargs.return_value = Auth(user=self.user)

        with app.test_request_context():
            url = api_url_for('get_dashboard')

        res = self.app.get(url + ALL_MY_REGISTRATIONS_ID)
        init_len = len(res.json[u'data'])

        RegistrationFactory(creator=self.user)
        res = self.app.get(url + ALL_MY_REGISTRATIONS_ID)
        assert_equal(len(res.json[u'data']), init_len + 1)
Exemplo n.º 3
0
    def test_adding_project_to_dashboard_increases_json_size_by_one(self, mock_from_kwargs):
        mock_from_kwargs.return_value = Auth(user=self.user)

        with app.test_request_context():
            url = api_url_for('get_dashboard')

        res = self.app.get(url + ALL_MY_PROJECTS_ID)

        import pprint;pp = pprint.PrettyPrinter()

        init_len = len(res.json[u'data'])

        ProjectFactory(creator=self.user)
        res = self.app.get(url + ALL_MY_PROJECTS_ID)
        assert_equal(len(res.json[u'data']), init_len + 1)
Exemplo n.º 4
0
    def test_adding_project_to_dashboard_increases_json_size_by_one(self, mock_from_kwargs):
        mock_from_kwargs.return_value = Auth(user=self.user)

        with app.test_request_context():
            url = api_url_for('get_dashboard')

        res = self.app.get(url + ALL_MY_PROJECTS_ID)

        import pprint;pp = pprint.PrettyPrinter()

        init_len = len(res.json[u'data'])

        ProjectFactory(creator=self.user)
        res = self.app.get(url + ALL_MY_PROJECTS_ID)
        assert_equal(len(res.json[u'data']), init_len + 1)