def setUp(self):
     """Setup."""
     self.widget = OTPGenWidget()
     self.env = Environment(
         loader=PackageLoader("django_otp.widgets", "files"))
     self.env.globals.update({
         "btn": self.widget.btn,
         "img": self.widget.img
     })
    class Form(Form):
        """Form."""

        gen = OTPGenField(widget=OTPGenWidget(
            img_attrs={"data-ng-src": "{{ model.qrcode }}"}))
Пример #3
0
 def setUp(self, *args):
     """Setup."""
     self.btn_attrs = {"data-ng-click": "test()", "type": "button"}
     self.widget = OTPGenWidget(btn_attrs=self.btn_attrs)
Пример #4
0
 def setUp(self, *args):
     """Setup."""
     self.img_attrs = {"data-ng-src": "{{ model.secret }}"}
     self.widget = OTPGenWidget(img_attrs=self.img_attrs)
Пример #5
0
 def setUp(self, *args):
     """Setup."""
     self.txt_attrs = {"data-ng-model": "model.secret"}
     self.widget = OTPGenWidget(attrs={"data-ng-model": "model.secret"})
Пример #6
0
 def setUp(self, loader, env):
     """Setup."""
     self.widget = OTPGenWidget()
     self.loader = loader
     self.env = env
Пример #7
0
 def setUp(self, *args):
     """Setup."""
     self.widget = OTPGenWidget(embed_script=True)
Пример #8
0
 def setUp(self, *args):
     """Setup."""
     self.widget = OTPGenWidget(enable_btn=False)
Пример #9
0
 def setUp(self, *args):
     """Setup."""
     self.btn_label = "Hello World"
     self.widget = OTPGenWidget(btn_label=self.btn_label)