lang: unit tests in django/await first loading of dict
This commit is contained in:
@ -1,3 +1,24 @@
|
||||
from django.test import TestCase
|
||||
import json
|
||||
from os import listdir
|
||||
|
||||
from django.test import Client, TestCase
|
||||
from django.contrib.staticfiles import finders
|
||||
|
||||
# Create your tests here.
|
||||
|
||||
class DictionnariesTest(TestCase):
|
||||
def setUp(self) -> None:
|
||||
self.client = Client();
|
||||
self.directory = finders.find('js/lang/');
|
||||
|
||||
def test_lang(self):
|
||||
keys = None
|
||||
|
||||
json_files = listdir(self.directory);
|
||||
for file in json_files:
|
||||
with open(f'{self.directory}/{file}') as f:
|
||||
data: dict = json.load(f);
|
||||
if (keys is None):
|
||||
keys = set(data.keys());
|
||||
else:
|
||||
self.assertEqual(set(data.keys()), keys);
|
||||
|
Reference in New Issue
Block a user