You are very right!
Please a ticket!

In the meantime you can use tester.getSession().setLocale(locale)

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, Apr 28, 2016 at 4:52 PM, Zbynek Vavros <[email protected]>
wrote:

> Hi,
>
> finally got to fix that test and I don't have method setLocale(aLocale) on
> MockHttpServletRequest.
> I am on Wicket 7.0.0...
>
> Zbynek
>
> On Tue, Apr 26, 2016 at 6:12 PM, Zbynek Vavros <[email protected]>
> wrote:
>
> > Hey,
> >
> > good point, thanks a lot !
> > I was using the inner workings of DateTextField to get the formatted
> > string with locale
> >
> > DateFormat.getDateInstance(DateFormat.SHORT,
> > Locale.getDefault()).format(date)
> >
> > but setting the locale on request is much better, thanks again !
> >
> > Zbynek
> >
> > On Tue, Apr 26, 2016 at 6:01 PM, Martin Grigorov <
> > [email protected]> wrote:
> >
> >> Hi,
> >>
> >> WicketTester simulates browser behavior, so it sends String that is
> >> converted to a Date by the Wicket component.
> >> You can use tester.getRequest().setLocale(aLocale) to simulate localized
> >> browser.
> >> On Apr 26, 2016 4:22 PM, "Zbynek Vavros" <[email protected]>
> wrote:
> >>
> >> Hi,
> >>
> >> whats the proper way to work with WicketTester and DateTimeFields ?
> >> I am using
> >>
> >> FormTester.setValue("myDateTimeField". "formattedDateTime");
> >>
> >> is there any way using proper date instead of string (that differs with
> >> locales) ?
> >> using DateTimeField.setModelObject() or
> >> DateTimeField.setDefaultModejObject
> >> breaks our validator that works with getConvertedInput...
> >>
> >> Thanks,
> >> Zbynek
> >>
> >
> >
>

Reply via email to