def test_add_groundstations(self):
        # Permissions test (1): no request, no permission
        try:
            launch_jrpc.add_groundstations(
                'FAKE_ID', None, **{'request': None}
            )
            self.fail('No request added, permission should not be granted')
        except django_ex.PermissionDenied:
            pass
        # Permissions test (2): user not authorized
        try:
            launch_jrpc.add_groundstations(
                'FAKE', None, **{'request': self.__request_1}
            )
            self.fail('No request added, permission should not be granted')
        except django_ex.PermissionDenied:
            pass
        # Basic parameters test (1)
        try:
            launch_jrpc.add_groundstations(
                'FAKE', ['fake'], **{'request': self.__request_2}
            )
            self.fail('The leop cluster does not exist')
        except launch_models.Launch.DoesNotExist:
            pass

        # Basic parameters test (2)
        self.assertRaises(
            Exception,
            launch_jrpc.add_groundstations,
            None, **{'request': self.__request_2}
        )

        # GroundStations array []
        gss = [self.__gs_1_id, self.__gs_2_id]
        actual = launch_jrpc.add_groundstations(
            self.__leop_id, gss, **{'request': self.__request_2}
        )
        expected = {launch_serial.JRPC_K_LEOP_ID: self.__leop_id}
        self.assertEqual(actual, expected)

        cluster = launch_models.Launch.objects.get(identifier=self.__leop_id)
        self.assertEqual(
            len(cluster.groundstations.all()), 2,
            'Two groundstations should be part of this cluster object'
        )
Signs the given string and also attaches a time information.
dataset/ETHPy150Open satnet-project/server/services/leop/tests/test_jrpc.py/TestLaunchViews.test_add_groundstations--crossover with--dataset/ETHPy150Open GeekTrainer/Flask/Work/Trivia - Module 5/env/Lib/site-packages/itsdangerous.py/TimestampSigner.sign