Fix rendering of copyable text input widgets.

Review Request #12465 — Created July 12, 2022 and submitted — Latest diff uploaded


The copyable text input widget (used for things like auto-generated IDs)
wasn't rendering properly. The major problem here is that Django changed
internally how things like the TextInput widget rendered. What was
happening is that even calling the superclass' render() method, it was
using self.template_name. This would render two copies of the copyable
text input widget template, one of which didn't have the correct
context. I've changed it to explicitly render the text input template.

We also had a CSS precedence issue which was causing the copy icon to be
rendered in blue. I've made the CSS rule for this icon to be a bit
higher priority so it doesn't get overridden.

  • Used the OAuth application edit form (which uses this widget in a
    couple different ways) and saw the correct result rather than having
    no text boxes and two copy icons.
  • Ran unit tests on all supported versions of Python.