Skip to content

Commit

Permalink
Merge pull request #2322 from liberapay/various
Browse files Browse the repository at this point in the history
  • Loading branch information
Changaco authored Mar 4, 2024
2 parents 8788fd9 + 76712b7 commit 8fe905e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions liberapay/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ def generate_value(self, currency):

EPOCH = datetime(1970, 1, 1, 0, 0, 0, 0, utc)

EUROZONE = set("AT BE CY DE EE ES FI FR GR IE IT LT LU LV MT NL PT SI SK".split())
SEPA = EUROZONE | set("AD BG CH CZ DK GB GI HR HU IS LI MC NO PL RO SE VA".split())
EUROZONE = set("AT BE CY DE EE ES FI FR GR HR IE IT LT LU LV MT NL PT SI SK".split())
SEPA = EUROZONE | set("AD BG CH CZ DK GB GI HU IS LI MC NO PL RO SE VA".split())

EVENTS = [
Event('income', 1, _("Every week as long as I am receiving donations")),
Expand Down
9 changes: 5 additions & 4 deletions tests/py/test_crypto.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import warnings

import pytest

Expand Down Expand Up @@ -57,13 +58,13 @@ def test_key_rotation(self):
assert new_info_2.payload == new_info.payload

def test_encrypt_dict_warns_of_single_key(self):
with pytest.warns(CryptoWarning, match="dict only contains one key") as warnings:
with pytest.warns(CryptoWarning, match="dict only contains one key") as w:
self.website.cryptograph.encrypt_dict({"long_single_key": None})
assert len(warnings) == 1
with pytest.warns(None) as warnings:
assert len(w) == 1
with warnings.catch_warnings(record=True) as w:
self.website.cryptograph.encrypt_dict({})
self.website.cryptograph.encrypt_dict({0: 1, 2: 3, 4: 5})
assert len(warnings) == 0
assert len(w) == 0

def test_encrypt_dict_randomizes_order(self):
cryptograph = self.website.cryptograph
Expand Down
4 changes: 2 additions & 2 deletions www/%username/edit/goal.spt
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ subhead = _("Goal")
<input type="radio" name="goal" id="goal-yes" value="custom"
{{ 'checked' if participant.goal and participant.goal > 0 else '' }}/>
<span>{{ GOAL_PARTS[0] }}</span>
% set goal_currency = participant.main_currency
<input type="hidden" name="currency" value="{{ goal_currency }}" />
<div><div class="input-group">
% set goal_currency = participant.main_currency
<input type="hidden" name="currency" value="{{ goal_currency }}" />
<div class="input-group-addon">{{ locale.currency_symbols.get(goal_currency, goal_currency) }}</div>
<input type="tel" inputmode="decimal" name="goal_custom" id="goal-custom"
class="amount form-control input-sm"
Expand Down

0 comments on commit 8fe905e

Please sign in to comment.