Example #1
0
File: views.py Project: fara/Pompom
 def get_context_data(self, **kwargs):
     board = get_object_or_404(Board, id=self.kwargs['pk'])
     return super().get_context_data(
         board=board,
         graded_cards=board.latest_graded_cards(),
         result_history=board.result_history(),
         token=MobileToken().ciphertext,
         safety_message=SafetyMessage.objects.first(),
         refresh_timer=settings.HUDDLE_BOARD_REFRESH_TIMER,
         **kwargs)
Example #2
0
 def test_token_built_from_random_string_is_invalid(self):
     some_arbitrary_string = 'AAADDwUCwQcNAA=='
     token = MobileToken(some_arbitrary_string)
     assert not token.is_valid()
Example #3
0
 def test_token_built_from_received_string_is_valid(self, a_token_string):
     token = MobileToken(a_token_string)
     assert token.is_valid()
Example #4
0
 def a_token_string(self):
     token = MobileToken()
     return token.ciphertext
Example #5
0
 def generate_token_from_datetime(self, datetime):
     with mock.patch('django.utils.timezone.now') as mock_now:
         mock_now.return_value = datetime
         token = MobileToken()
     return token
Example #6
0
 def a_token(self):
     return MobileToken()
Example #7
0
File: views.py Project: fara/Pompom
 def test_func(self):
     token = MobileToken(self.kwargs['token'])
     return token.is_valid()
Example #8
0
File: views.py Project: fara/Pompom
 def get_context_data(self, **kwargs):
     board = get_object_or_404(Board, id=self.kwargs['pk'])
     return super().get_context_data(board=board,
                                     token=MobileToken().ciphertext,
                                     **kwargs)